@ -515,6 +515,7 @@ exports.default = _default;
"use strict" ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . MatchKind = void 0 ;
/ * *
* Indicates whether a pattern matches a path
* /
@ -4213,7 +4214,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
} ) ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . hashFiles = exports . create = void 0 ;
const internal _globber _1 = _ _webpack _require _ _ ( 297 ) ;
const internal _hash _files _1 = _ _webpack _require _ _ ( 730 ) ;
/ * *
* Constructs a globber
*
@ -4226,6 +4229,23 @@ function create(patterns, options) {
} ) ;
}
exports . create = create ;
/ * *
* Computes the sha256 hash of a glob
*
* @ param patterns Patterns separated by newlines
* @ param options Glob options
* /
function hashFiles ( patterns , options , verbose = false ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
let followSymbolicLinks = true ;
if ( options && typeof options . followSymbolicLinks === 'boolean' ) {
followSymbolicLinks = options . followSymbolicLinks ;
}
const globber = yield create ( patterns , { followSymbolicLinks } ) ;
return internal _hash _files _1 . hashFiles ( globber , verbose ) ;
} ) ;
}
exports . hashFiles = hashFiles ;
//# sourceMappingURL=glob.js.map
/***/ } ) ,
@ -4235,6 +4255,25 @@ exports.create = create;
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
var _ _awaiter = ( this && this . _ _awaiter ) || function ( thisArg , _arguments , P , generator ) {
function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
@ -4264,11 +4303,12 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
function settle ( f , v ) { if ( f ( v ) , q . shift ( ) , q . length ) resume ( q [ 0 ] [ 0 ] , q [ 0 ] [ 1 ] ) ; }
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const core = _ _webpack _require _ _ ( 470 ) ;
const fs = _ _webpack _require _ _ ( 747 ) ;
const globOptionsHelper = _ _webpack _require _ _ ( 601 ) ;
const path = _ _webpack _require _ _ ( 622 ) ;
const patternHelper = _ _webpack _require _ _ ( 597 ) ;
exports . DefaultGlobber = void 0 ;
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
const fs = _ _importStar ( _ _webpack _require _ _ ( 747 ) ) ;
const globOptionsHelper = _ _importStar ( _ _webpack _require _ _ ( 601 ) ) ;
const path = _ _importStar ( _ _webpack _require _ _ ( 622 ) ) ;
const patternHelper = _ _importStar ( _ _webpack _require _ _ ( 597 ) ) ;
const internal _match _kind _1 = _ _webpack _require _ _ ( 36 ) ;
const internal _pattern _1 = _ _webpack _require _ _ ( 923 ) ;
const internal _search _state _1 = _ _webpack _require _ _ ( 728 ) ;
@ -4314,7 +4354,7 @@ class DefaultGlobber {
if ( options . implicitDescendants &&
( pattern . trailingSeparator ||
pattern . segments [ pattern . segments . length - 1 ] !== '**' ) ) {
patterns . push ( new internal _pattern _1 . Pattern ( pattern . negate , pattern . segments . concat ( '**' ) ) ) ;
patterns . push ( new internal _pattern _1 . Pattern ( pattern . negate , true , pattern . segments . concat ( '**' ) ) ) ;
}
}
// Push the search paths
@ -4357,7 +4397,7 @@ class DefaultGlobber {
// Directory
if ( stats . isDirectory ( ) ) {
// Matched
if ( match & internal _match _kind _1 . MatchKind . Directory ) {
if ( match & internal _match _kind _1 . MatchKind . Directory && options . matchDirectories ) {
yield yield _ _await ( item . path ) ;
}
// Descend?
@ -4979,10 +5019,33 @@ exports.DefaultArtifactClient = DefaultArtifactClient;
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
var _ _importDefault = ( this && this . _ _importDefault ) || function ( mod ) {
return ( mod && mod . _ _esModule ) ? mod : { "default" : mod } ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const assert = _ _webpack _require _ _ ( 357 ) ;
const path = _ _webpack _require _ _ ( 622 ) ;
const pathHelper = _ _webpack _require _ _ ( 972 ) ;
exports . Path = void 0 ;
const path = _ _importStar ( _ _webpack _require _ _ ( 622 ) ) ;
const pathHelper = _ _importStar ( _ _webpack _require _ _ ( 972 ) ) ;
const assert _1 = _ _importDefault ( _ _webpack _require _ _ ( 357 ) ) ;
const IS _WINDOWS = process . platform === 'win32' ;
/ * *
* Helper class for parsing paths into segments
@ -4996,7 +5059,7 @@ class Path {
this . segments = [ ] ;
// String
if ( typeof itemPath === 'string' ) {
assert ( itemPath , ` Parameter 'itemPath' must not be empty ` ) ;
assert _1 . default ( itemPath , ` Parameter 'itemPath' must not be empty ` ) ;
// Normalize slashes and trim unnecessary trailing slash
itemPath = pathHelper . safeTrimTrailingSeparator ( itemPath ) ;
// Not rooted
@ -5023,24 +5086,24 @@ class Path {
// Array
else {
// Must not be empty
assert ( itemPath . length > 0 , ` Parameter 'itemPath' must not be an empty array ` ) ;
assert _1 . default ( itemPath . length > 0 , ` Parameter 'itemPath' must not be an empty array ` ) ;
// Each segment
for ( let i = 0 ; i < itemPath . length ; i ++ ) {
let segment = itemPath [ i ] ;
// Must not be empty
assert ( segment , ` Parameter 'itemPath' must not contain any empty segments ` ) ;
assert _1 . default ( segment , ` Parameter 'itemPath' must not contain any empty segments ` ) ;
// Normalize slashes
segment = pathHelper . normalizeSeparators ( itemPath [ i ] ) ;
// Root segment
if ( i === 0 && pathHelper . hasRoot ( segment ) ) {
segment = pathHelper . safeTrimTrailingSeparator ( segment ) ;
assert ( segment === pathHelper . dirname ( segment ) , ` Parameter 'itemPath' root segment contains information for multiple segments ` ) ;
assert _1 . default ( segment === pathHelper . dirname ( segment ) , ` Parameter 'itemPath' root segment contains information for multiple segments ` ) ;
this . segments . push ( segment ) ;
}
// All other segments
else {
// Must not contain slash
assert ( ! segment . includes ( path . sep ) , ` Parameter 'itemPath' contains unexpected path separators ` ) ;
assert _1 . default ( ! segment . includes ( path . sep ) , ` Parameter 'itemPath' contains unexpected path separators ` ) ;
this . segments . push ( segment ) ;
}
}
@ -7963,8 +8026,28 @@ exports.getUploadSpecification = getUploadSpecification;
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const pathHelper = _ _webpack _require _ _ ( 972 ) ;
exports . partialMatch = exports . match = exports . getSearchPaths = void 0 ;
const pathHelper = _ _importStar ( _ _webpack _require _ _ ( 972 ) ) ;
const internal _match _kind _1 = _ _webpack _require _ _ ( 36 ) ;
const IS _WINDOWS = process . platform === 'win32' ;
/ * *
@ -8044,8 +8127,28 @@ exports.partialMatch = partialMatch;
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const core = _ _webpack _require _ _ ( 470 ) ;
exports . getOptions = void 0 ;
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
/ * *
* Returns a copy with defaults filled in .
* /
@ -8053,6 +8156,7 @@ function getOptions(copy) {
const result = {
followSymbolicLinks : true ,
implicitDescendants : true ,
matchDirectories : true ,
omitBrokenSymbolicLinks : true
} ;
if ( copy ) {
@ -8064,6 +8168,10 @@ function getOptions(copy) {
result . implicitDescendants = copy . implicitDescendants ;
core . debug ( ` implicitDescendants ' ${ result . implicitDescendants } ' ` ) ;
}
if ( typeof copy . matchDirectories === 'boolean' ) {
result . matchDirectories = copy . matchDirectories ;
core . debug ( ` matchDirectories ' ${ result . matchDirectories } ' ` ) ;
}
if ( typeof copy . omitBrokenSymbolicLinks === 'boolean' ) {
result . omitBrokenSymbolicLinks = copy . omitBrokenSymbolicLinks ;
core . debug ( ` omitBrokenSymbolicLinks ' ${ result . omitBrokenSymbolicLinks } ' ` ) ;
@ -9190,6 +9298,7 @@ exports.default = _default;
"use strict" ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . SearchState = void 0 ;
class SearchState {
constructor ( path , level ) {
this . path = path ;
@ -9201,6 +9310,108 @@ exports.SearchState = SearchState;
/***/ } ) ,
/***/ 730 :
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
var _ _awaiter = ( this && this . _ _awaiter ) || function ( thisArg , _arguments , P , generator ) {
function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
function fulfilled ( value ) { try { step ( generator . next ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function rejected ( value ) { try { step ( generator [ "throw" ] ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function step ( result ) { result . done ? resolve ( result . value ) : adopt ( result . value ) . then ( fulfilled , rejected ) ; }
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
} ) ;
} ;
var _ _asyncValues = ( this && this . _ _asyncValues ) || function ( o ) {
if ( ! Symbol . asyncIterator ) throw new TypeError ( "Symbol.asyncIterator is not defined." ) ;
var m = o [ Symbol . asyncIterator ] , i ;
return m ? m . call ( o ) : ( o = typeof _ _values === "function" ? _ _values ( o ) : o [ Symbol . iterator ] ( ) , i = { } , verb ( "next" ) , verb ( "throw" ) , verb ( "return" ) , i [ Symbol . asyncIterator ] = function ( ) { return this ; } , i ) ;
function verb ( n ) { i [ n ] = o [ n ] && function ( v ) { return new Promise ( function ( resolve , reject ) { v = o [ n ] ( v ) , settle ( resolve , reject , v . done , v . value ) ; } ) ; } ; }
function settle ( resolve , reject , d , v ) { Promise . resolve ( v ) . then ( function ( v ) { resolve ( { value : v , done : d } ) ; } , reject ) ; }
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . hashFiles = void 0 ;
const crypto = _ _importStar ( _ _webpack _require _ _ ( 417 ) ) ;
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
const fs = _ _importStar ( _ _webpack _require _ _ ( 747 ) ) ;
const stream = _ _importStar ( _ _webpack _require _ _ ( 794 ) ) ;
const util = _ _importStar ( _ _webpack _require _ _ ( 669 ) ) ;
const path = _ _importStar ( _ _webpack _require _ _ ( 622 ) ) ;
function hashFiles ( globber , verbose = false ) {
var e _1 , _a ;
var _b ;
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
const writeDelegate = verbose ? core . info : core . debug ;
let hasMatch = false ;
const githubWorkspace = ( _b = process . env [ 'GITHUB_WORKSPACE' ] ) !== null && _b !== void 0 ? _b : process . cwd ( ) ;
const result = crypto . createHash ( 'sha256' ) ;
let count = 0 ;
try {
for ( var _c = _ _asyncValues ( globber . globGenerator ( ) ) , _d ; _d = yield _c . next ( ) , ! _d . done ; ) {
const file = _d . value ;
writeDelegate ( file ) ;
if ( ! file . startsWith ( ` ${ githubWorkspace } ${ path . sep } ` ) ) {
writeDelegate ( ` Ignore ' ${ file } ' since it is not under GITHUB_WORKSPACE. ` ) ;
continue ;
}
if ( fs . statSync ( file ) . isDirectory ( ) ) {
writeDelegate ( ` Skip directory ' ${ file } '. ` ) ;
continue ;
}
const hash = crypto . createHash ( 'sha256' ) ;
const pipeline = util . promisify ( stream . pipeline ) ;
yield pipeline ( fs . createReadStream ( file ) , hash ) ;
result . write ( hash . digest ( ) ) ;
count ++ ;
if ( ! hasMatch ) {
hasMatch = true ;
}
}
}
catch ( e _1 _1 ) { e _1 = { error : e _1 _1 } ; }
finally {
try {
if ( _d && ! _d . done && ( _a = _c . return ) ) yield _a . call ( _c ) ;
}
finally { if ( e _1 ) throw e _1 . error ; }
}
result . end ( ) ;
if ( hasMatch ) {
writeDelegate ( ` Found ${ count } files to hash. ` ) ;
return result . digest ( 'hex' ) ;
}
else {
writeDelegate ( ` No matches found for glob ` ) ;
return '' ;
}
} ) ;
}
exports . hashFiles = hashFiles ;
//# sourceMappingURL=internal-hash-files.js.map
/***/ } ) ,
/***/ 733 :
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
@ -9596,6 +9807,13 @@ class DownloadHttpClient {
} ;
const resetDestinationStream = ( fileDownloadPath ) => _ _awaiter ( this , void 0 , void 0 , function * ( ) {
destinationStream . close ( ) ;
// await until file is created at downloadpath; node15 and up fs.createWriteStream had not created a file yet
yield new Promise ( resolve => {
destinationStream . on ( 'close' , resolve ) ;
if ( destinationStream . writableFinished ) {
resolve ( ) ;
}
} ) ;
yield utils _1 . rmFile ( fileDownloadPath ) ;
destinationStream = fs . createWriteStream ( fileDownloadPath ) ;
} ) ;
@ -10453,17 +10671,40 @@ var isArray = Array.isArray || function (xs) {
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
var _ _importDefault = ( this && this . _ _importDefault ) || function ( mod ) {
return ( mod && mod . _ _esModule ) ? mod : { "default" : mod } ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const assert = _ _webpack _require _ _ ( 357 ) ;
const os = _ _webpack _require _ _ ( 87 ) ;
const path = _ _webpack _require _ _ ( 622 ) ;
const pathHelper = _ _webpack _require _ _ ( 972 ) ;
exports . Pattern = void 0 ;
const os = _ _importStar ( _ _webpack _require _ _ ( 87 ) ) ;
const path = _ _importStar ( _ _webpack _require _ _ ( 622 ) ) ;
const pathHelper = _ _importStar ( _ _webpack _require _ _ ( 972 ) ) ;
const assert _1 = _ _importDefault ( _ _webpack _require _ _ ( 357 ) ) ;
const minimatch _1 = _ _webpack _require _ _ ( 93 ) ;
const internal _match _kind _1 = _ _webpack _require _ _ ( 36 ) ;
const internal _path _1 = _ _webpack _require _ _ ( 383 ) ;
const IS _WINDOWS = process . platform === 'win32' ;
class Pattern {
constructor ( patternOrNegate , segments ) {
constructor ( patternOrNegate , isImplicitPattern = false , segments, homedir ) {
/ * *
* Indicates whether matches should be excluded from the result set
* /
@ -10477,9 +10718,9 @@ class Pattern {
else {
// Convert to pattern
segments = segments || [ ] ;
assert ( segments . length , ` Parameter 'segments' must not empty ` ) ;
assert _1 . default ( segments . length , ` Parameter 'segments' must not empty ` ) ;
const root = Pattern . getLiteral ( segments [ 0 ] ) ;
assert ( root && pathHelper . hasAbsoluteRoot ( root ) , ` Parameter 'segments' first element must be a root path ` ) ;
assert _1 . default ( root && pathHelper . hasAbsoluteRoot ( root ) , ` Parameter 'segments' first element must be a root path ` ) ;
pattern = new internal _path _1 . Path ( segments ) . toString ( ) . trim ( ) ;
if ( patternOrNegate ) {
pattern = ` ! ${ pattern } ` ;
@ -10491,7 +10732,7 @@ class Pattern {
pattern = pattern . substr ( 1 ) . trim ( ) ;
}
// Normalize slashes and ensures absolute root
pattern = Pattern . fixupPattern ( pattern );
pattern = Pattern . fixupPattern ( pattern , homedir );
// Segments
this . segments = new internal _path _1 . Path ( pattern ) . segments ;
// Trailing slash indicates the pattern should only match directories, not regular files
@ -10507,6 +10748,7 @@ class Pattern {
this . searchPath = new internal _path _1 . Path ( searchSegments ) . toString ( ) ;
// Root RegExp (required when determining partial match)
this . rootRegExp = new RegExp ( Pattern . regExpEscape ( searchSegments [ 0 ] ) , IS _WINDOWS ? 'i' : '' ) ;
this . isImplicitPattern = isImplicitPattern ;
// Create minimatch
const minimatchOptions = {
dot : true ,
@ -10528,11 +10770,11 @@ class Pattern {
// Normalize slashes
itemPath = pathHelper . normalizeSeparators ( itemPath ) ;
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
// prece e ding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
// prece ding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
if ( ! itemPath . endsWith ( path . sep ) ) {
if ( ! itemPath . endsWith ( path . sep ) && this . isImplicitPattern === false ) {
// Note, this is safe because the constructor ensures the pattern has an absolute root.
// For example, formats like C: and C:foo on Windows are resolved to an ab o slute root.
// For example, formats like C: and C:foo on Windows are resolved to an ab so lute root.
itemPath = ` ${ itemPath } ${ path . sep } ` ;
}
}
@ -10570,15 +10812,15 @@ class Pattern {
/ * *
* Normalizes slashes and ensures absolute root
* /
static fixupPattern ( pattern ) {
static fixupPattern ( pattern , homedir ) {
// Empty
assert ( pattern , 'pattern cannot be empty' ) ;
assert _1 . default ( pattern , 'pattern cannot be empty' ) ;
// Must not contain `.` segment, unless first segment
// Must not contain `..` segment
const literalSegments = new internal _path _1 . Path ( pattern ) . segments . map ( x => Pattern . getLiteral ( x ) ) ;
assert ( literalSegments . every ( ( x , i ) => ( x !== '.' || i === 0 ) && x !== '..' ) , ` Invalid pattern ' ${ pattern } '. Relative pathing '.' and '..' is not allowed. ` ) ;
assert _1 . default ( literalSegments . every ( ( x , i ) => ( x !== '.' || i === 0 ) && x !== '..' ) , ` Invalid pattern ' ${ pattern } '. Relative pathing '.' and '..' is not allowed. ` ) ;
// Must not contain globs in root, e.g. Windows UNC path \\foo\b*r
assert ( ! pathHelper . hasRoot ( pattern ) || literalSegments [ 0 ] , ` Invalid pattern ' ${ pattern } '. Root segment must not contain globs. ` ) ;
assert _1 . default ( ! pathHelper . hasRoot ( pattern ) || literalSegments [ 0 ] , ` Invalid pattern ' ${ pattern } '. Root segment must not contain globs. ` ) ;
// Normalize slashes
pattern = pathHelper . normalizeSeparators ( pattern ) ;
// Replace leading `.` segment
@ -10587,9 +10829,9 @@ class Pattern {
}
// Replace leading `~` segment
else if ( pattern === '~' || pattern . startsWith ( ` ~ ${ path . sep } ` ) ) {
const homedir = os . homedir ( ) ;
assert ( homedir , 'Unable to determine HOME directory' ) ;
assert ( pathHelper . hasAbsoluteRoot ( homedir ) , ` Expected HOME directory to be a rooted path. Actual ' ${ homedir } ' ` ) ;
homedir = homedir || os . homedir ( ) ;
assert _1 . default ( homedir , 'Unable to determine HOME directory' ) ;
assert _1 . default ( pathHelper . hasAbsoluteRoot ( homedir ) , ` Expected HOME directory to be a rooted path. Actual ' ${ homedir } ' ` ) ;
pattern = Pattern . globEscape ( homedir ) + pattern . substr ( 1 ) ;
}
// Replace relative drive root, e.g. pattern is C: or C:foo
@ -10691,9 +10933,32 @@ exports.Pattern = Pattern;
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
var _ _importDefault = ( this && this . _ _importDefault ) || function ( mod ) {
return ( mod && mod . _ _esModule ) ? mod : { "default" : mod } ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const assert = _ _webpack _require _ _ ( 357 ) ;
const path = _ _webpack _require _ _ ( 622 ) ;
exports . safeTrimTrailingSeparator = exports . normalizeSeparators = exports . hasRoot = exports . hasAbsoluteRoot = exports . ensureAbsoluteRoot = exports . dirname = void 0 ;
const path = _ _importStar ( _ _webpack _require _ _ ( 622 ) ) ;
const assert _1 = _ _importDefault ( _ _webpack _require _ _ ( 357 ) ) ;
const IS _WINDOWS = process . platform === 'win32' ;
/ * *
* Similar to path . dirname except normalizes the path separators and slightly better handling for Windows UNC paths .
@ -10733,8 +10998,8 @@ exports.dirname = dirname;
* or ` C: ` are expanded based on the current working directory .
* /
function ensureAbsoluteRoot ( root , itemPath ) {
assert ( root , ` ensureAbsoluteRoot parameter 'root' must not be empty ` ) ;
assert ( itemPath , ` ensureAbsoluteRoot parameter 'itemPath' must not be empty ` ) ;
assert _1 . default ( root , ` ensureAbsoluteRoot parameter 'root' must not be empty ` ) ;
assert _1 . default ( itemPath , ` ensureAbsoluteRoot parameter 'itemPath' must not be empty ` ) ;
// Already rooted
if ( hasAbsoluteRoot ( itemPath ) ) {
return itemPath ;
@ -10744,7 +11009,7 @@ function ensureAbsoluteRoot(root, itemPath) {
// Check for itemPath like C: or C:foo
if ( itemPath . match ( /^[A-Z]:[^\\/]|^[A-Z]:$/i ) ) {
let cwd = process . cwd ( ) ;
assert ( cwd . match ( /^[A-Z]:\\/i ) , ` Expected current directory to start with an absolute drive root. Actual ' ${ cwd } ' ` ) ;
assert _1 . default ( cwd . match ( /^[A-Z]:\\/i ) , ` Expected current directory to start with an absolute drive root. Actual ' ${ cwd } ' ` ) ;
// Drive letter matches cwd? Expand to cwd
if ( itemPath [ 0 ] . toUpperCase ( ) === cwd [ 0 ] . toUpperCase ( ) ) {
// Drive only, e.g. C:
@ -10769,11 +11034,11 @@ function ensureAbsoluteRoot(root, itemPath) {
// Check for itemPath like \ or \foo
else if ( normalizeSeparators ( itemPath ) . match ( /^\\$|^\\[^\\]/ ) ) {
const cwd = process . cwd ( ) ;
assert ( cwd . match ( /^[A-Z]:\\/i ) , ` Expected current directory to start with an absolute drive root. Actual ' ${ cwd } ' ` ) ;
assert _1 . default ( cwd . match ( /^[A-Z]:\\/i ) , ` Expected current directory to start with an absolute drive root. Actual ' ${ cwd } ' ` ) ;
return ` ${ cwd [ 0 ] } : \\ ${ itemPath . substr ( 1 ) } ` ;
}
}
assert ( hasAbsoluteRoot ( root ) , ` ensureAbsoluteRoot parameter 'root' must have an absolute root ` ) ;
assert _1 . default ( hasAbsoluteRoot ( root ) , ` ensureAbsoluteRoot parameter 'root' must have an absolute root ` ) ;
// Otherwise ensure root ends with a separator
if ( root . endsWith ( '/' ) || ( IS _WINDOWS && root . endsWith ( '\\' ) ) ) {
// Intentionally empty
@ -10790,7 +11055,7 @@ exports.ensureAbsoluteRoot = ensureAbsoluteRoot;
* ` \\ hello \s hare ` and ` C: \h ello ` ( and using alternate separator ) .
* /
function hasAbsoluteRoot ( itemPath ) {
assert ( itemPath , ` hasAbsoluteRoot parameter 'itemPath' must not be empty ` ) ;
assert _1 . default ( itemPath , ` hasAbsoluteRoot parameter 'itemPath' must not be empty ` ) ;
// Normalize separators
itemPath = normalizeSeparators ( itemPath ) ;
// Windows
@ -10807,7 +11072,7 @@ exports.hasAbsoluteRoot = hasAbsoluteRoot;
* ` \` , ` \ hello ` , ` \ \ hello \ share ` , ` C : ` , and ` C : \ hello ` (and using alternate separator).
* /
function hasRoot ( itemPath ) {
assert ( itemPath , ` isRooted parameter 'itemPath' must not be empty ` ) ;
assert _1 . default ( itemPath , ` isRooted parameter 'itemPath' must not be empty ` ) ;
// Normalize separators
itemPath = normalizeSeparators ( itemPath ) ;
// Windows