@ -98,6 +98,25 @@ module.exports = Octokit;
"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 ) {
@ -108,11 +127,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
} ) ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const childProcess = _ _webpack _require _ _ ( 129 ) ;
const path = _ _webpack _require _ _ ( 622 ) ;
exports . findInPath = exports . which = exports . mkdirP = exports . rmRF = exports . mv = exports . cp = void 0 ;
const assert _1 = _ _webpack _require _ _ ( 357 ) ;
const childProcess = _ _importStar ( _ _webpack _require _ _ ( 129 ) ) ;
const path = _ _importStar ( _ _webpack _require _ _ ( 622 ) ) ;
const util _1 = _ _webpack _require _ _ ( 669 ) ;
const ioUtil = _ _webpack _require _ _ ( 672 ) ;
const ioUtil = _ _ importStar( _ _ webpack_require _ _ ( 672 ) ) ;
const exec = util _1 . promisify ( childProcess . exec ) ;
const execFile = util _1 . promisify ( childProcess . execFile ) ;
/ * *
* Copies a file or folder .
* Based off of shelljs - https : //github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
@ -123,14 +145,14 @@ const exec = util_1.promisify(childProcess.exec);
* /
function cp ( source , dest , options = { } ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
const { force , recursive } = readCopyOptions ( options ) ;
const { force , recursive , copySourceDirectory } = readCopyOptions ( options ) ;
const destStat = ( yield ioUtil . exists ( dest ) ) ? yield ioUtil . stat ( dest ) : null ;
// Dest is an existing file, but not forcing
if ( destStat && destStat . isFile ( ) && ! force ) {
return ;
}
// If dest is an existing directory, should copy inside.
const newDest = destStat && destStat . isDirectory ( )
const newDest = destStat && destStat . isDirectory ( ) && copySourceDirectory
? path . join ( dest , path . basename ( source ) )
: dest ;
if ( ! ( yield ioUtil . exists ( source ) ) ) {
@ -195,12 +217,22 @@ function rmRF(inputPath) {
if ( ioUtil . IS _WINDOWS ) {
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
// Check for invalid characters
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
if ( /[*"<>|]/ . test ( inputPath ) ) {
throw new Error ( 'File path must not contain `*`, `"`, `<`, `>` or `|` on Windows' ) ;
}
try {
const cmdPath = ioUtil . getCmdPath ( ) ;
if ( yield ioUtil . isDirectory ( inputPath , true ) ) {
yield exec ( ` rd /s /q " ${ inputPath } " ` ) ;
yield exec ( ` ${ cmdPath } /s /c "rd /s /q "%inputPath%"" ` , {
env : { inputPath }
} ) ;
}
else {
yield exec ( ` del /f /a " ${ inputPath } " ` ) ;
yield exec ( ` ${ cmdPath } /s /c "del /f /a "%inputPath%"" ` , {
env : { inputPath }
} ) ;
}
}
catch ( err ) {
@ -233,7 +265,7 @@ function rmRF(inputPath) {
return ;
}
if ( isDir ) {
yield exec ( ` rm -rf " ${ inputPath } " ` ) ;
yield exec File( ` rm ` , [ ` -rf ` , ` ${ inputPath } ` ] ) ;
}
else {
yield ioUtil . unlink ( inputPath ) ;
@ -251,7 +283,8 @@ exports.rmRF = rmRF;
* /
function mkdirP ( fsPath ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
yield ioUtil . mkdirP ( fsPath ) ;
assert _1 . ok ( fsPath , 'a path argument must be provided' ) ;
yield ioUtil . mkdir ( fsPath , { recursive : true } ) ;
} ) ;
}
exports . mkdirP = mkdirP ;
@ -279,62 +312,80 @@ function which(tool, check) {
throw new Error ( ` Unable to locate executable file: ${ tool } . Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable. ` ) ;
}
}
return result ;
}
try {
// build the list of extensions to try
const extensions = [ ] ;
if ( ioUtil . IS _WINDOWS && process . env . PATHEXT ) {
for ( const extension of process . env . PATHEXT . split ( path . delimiter ) ) {
if ( extension ) {
extensions . push ( extension ) ;
}
}
}
// if it's rooted, return it if exists. otherwise return empty.
if ( ioUtil . isRooted ( tool ) ) {
const filePath = yield ioUtil . tryGetExecutablePath ( tool , extensions ) ;
if ( filePath ) {
return filePath ;
const matches = yield findInPath ( tool ) ;
if ( matches && matches . length > 0 ) {
return matches [ 0 ] ;
}
return '' ;
} ) ;
}
exports . which = which ;
/ * *
* Returns a list of all occurrences of the given tool on the system path .
*
* @ returns Promise < string [ ] > the paths of the tool
* /
function findInPath ( tool ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
if ( ! tool ) {
throw new Error ( "parameter 'tool' is required" ) ;
}
// build the list of extensions to try
const extensions = [ ] ;
if ( ioUtil . IS _WINDOWS && process . env [ 'PATHEXT' ] ) {
for ( const extension of process . env [ 'PATHEXT' ] . split ( path . delimiter ) ) {
if ( extension ) {
extensions . push ( extension ) ;
}
return '' ;
}
// if any path separators, return empty
if ( tool . includes ( '/' ) || ( ioUtil . IS _WINDOWS && tool . includes ( '\\' ) ) ) {
return '' ;
}
// build the list of directories
//
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
// it feels like we should not do this. Checking the current directory seems like more of a use
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
// across platforms.
const directories = [ ] ;
if ( process . env . PATH ) {
for ( const p of process . env . PATH . split ( path . delimiter ) ) {
if ( p ) {
directories . push ( p ) ;
}
}
}
// if it's rooted, return it if exists. otherwise return empty.
if ( ioUtil . isRooted ( tool ) ) {
const filePath = yield ioUtil . tryGetExecutablePath ( tool , extensions ) ;
if ( filePath ) {
return [ filePath ] ;
}
// return the first match
for ( const directory of directories ) {
const filePath = yield ioUtil . tryGetExecutablePath ( directory + path . sep + tool , extensions ) ;
if ( filePath ) {
return filePath ;
return [ ] ;
}
// if any path separators, return empty
if ( tool . includes ( path . sep ) ) {
return [ ] ;
}
// build the list of directories
//
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
// it feels like we should not do this. Checking the current directory seems like more of a use
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
// across platforms.
const directories = [ ] ;
if ( process . env . PATH ) {
for ( const p of process . env . PATH . split ( path . delimiter ) ) {
if ( p ) {
directories . push ( p ) ;
}
}
return '' ;
}
catch ( err ) {
throw new Error ( ` which failed with message ${ err . message } ` ) ;
// find all matches
const matches = [ ] ;
for ( const directory of directories ) {
const filePath = yield ioUtil . tryGetExecutablePath ( path . join ( directory , tool ) , extensions ) ;
if ( filePath ) {
matches . push ( filePath ) ;
}
}
return matches ;
} ) ;
}
exports . which = which ;
exports . findInPath = findInPat h;
function readCopyOptions ( options ) {
const force = options . force == null ? true : options . force ;
const recursive = Boolean ( options . recursive ) ;
return { force , recursive } ;
const copySourceDirectory = options . copySourceDirectory == null
? true
: Boolean ( options . copySourceDirectory ) ;
return { force , recursive , copySourceDirectory } ;
}
function cpDirRecursive ( sourceDir , destDir , currentDepth , force ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
@ -4710,7 +4761,7 @@ module.exports = require("punycode");
/***/ 215 :
/***/ ( function ( module ) {
module . exports = { " name": "@octokit/rest" , "version" : "16.43.1" , "publishConfig" : { "access" : "public" } , "description" : "GitHub REST API client for Node.js" , "keywords" : [ "octokit" , "github" , "rest" , "api-client" ] , "author" : "Gregor Martynus (https://github.com/gr2m)" , "contributors" : [ { "name" : "Mike de Boer" , "email" : "info@mikedeboer.nl" } , { "name" : "Fabian Jakobs" , "email" : "fabian@c9.io" } , { "name" : "Joe Gallo" , "email" : "joe@brassafrax.com" } , { "name" : "Gregor Martynus" , "url" : "https://github.com/gr2m" } ] , "repository" : "https://github.com/octokit/rest.js" , "dependencies" : { "@octokit/auth-token" : "^2.4.0" , "@octokit/plugin-paginate-rest" : "^1.1.1" , "@octokit/plugin-request-log" : "^1.0.0" , "@octokit/plugin-rest-endpoint-methods" : "2.4.0" , "@octokit/request" : "^5.2.0" , "@octokit/request-error" : "^1.0.2" , "atob-lite" : "^2.0.0" , "before-after-hook" : "^2.0.0" , "btoa-lite" : "^1.0.0" , "deprecation" : "^2.0.0" , "lodash.get" : "^4.4.2" , "lodash.set" : "^4.3.2" , "lodash.uniq" : "^4.5.0" , "octokit-pagination-methods" : "^1.1.0" , "once" : "^1.4.0" , "universal-user-agent" : "^4.0.0" } , "de vDependencies": { "@gimenete/type-writer" : "^0.1.3" , "@octokit/auth" : "^1.1.1" , "@octokit/fixtures-server" : "^5.0.6" , "@octokit/graphql" : "^4.2.0" , "@types/node" : "^13.1.0" , "bundlesize" : "^0.18.0" , "chai" : "^4.1.2" , "compression-webpack-plugin" : "^3.1.0" , "cypress" : "^3.0.0" , "glob" : "^7.1.2" , "http-proxy-agent" : "^4.0.0" , "lodash.camelcase" : "^4.3.0" , "lodash.merge" : "^4.6.1" , "lodash.upperfirst" : "^4.3.1" , "lolex" : "^5.1.2" , "mkdirp" : "^1.0.0" , "mocha" : "^7.0.1" , "mustache" : "^4.0.0" , "nock" : "^11.3.3" , "npm-run-all" : "^4.1.2" , "nyc" : "^15.0.0" , "prettier" : "^1.14.2" , "proxy" : "^1.0.0" , "semantic-release" : "^17.0.0" , "sinon" : "^8.0.0" , "sinon-chai" : "^3.0.0" , "sort-keys" : "^4.0.0" , "string-to-arraybuffer" : "^1.0.0" , "string-to-jsdoc-comment" : "^1.0.0" , "typescript" : "^3.3.1" , "webpack" : "^4.0.0" , "webpack-bundle-analyzer" : "^3.0.0" , "webpack-cli" : "^3.0.0" } , " types": "index.d.ts" , "scripts" : { "coverage" : "nyc report --reporter=html && open coverage/index.html" , "lint" : "prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json" , "lint:fix" : "prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json" , "pretest" : "npm run -s lint" , "test" : "nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"" , "test:browser" : "cypress run --browser chrome" , "build" : "npm-run-all build:*" , "build:ts" : "npm run -s update-endpoints:typescript" , "prebuild:browser" : "mkdirp dist/ ", "build:browser" : "npm-run-all build:browser:*" , "build:browser:development" : "webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json" , "build:browser:production" : "webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map" , " generate-bundle-report": "webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html" , " update-endpoints": "npm-run-all update-endpoints:*" , "update-endpoints:fetch-json" : "node scripts/update-endpoints/fetch-json" , "update-endpoints:typescript" : "node scripts/update-endpoints/typescript" , "prevalidate:ts" : "npm run -s build:ts" , "validate:ts" : "tsc --target es6 --noImplicitAny index.d.ts" , "postvalidate:ts" : "tsc --noEmit --target es6 test/typescript-validate. ts", "start-fixtures-server" : "octokit-fixtures-server" }, "license" : "MIT" , "files" : [ "index.js" , "index.d.ts" , "lib" , "plugins" ] , "nyc" : { "ignore" : [ "test" ] } , "release" : { "publish" : [ "@semantic-release/npm" , { "path" : "@semantic-release/github" , "assets" : [ "dist/*" , "!dist/*.map.gz" ] } ] } , "bundlesize" : [ { "path" : "./dist/octokit-rest.min.js.gz" , "maxSize" : "33 kB" } ] } ;
module . exports = { " _args": [ [ "@octokit/rest@16.43.1" , "/workspaces/checkout" ] ] , "_from" : "@octokit/rest@16.43.1" , "_id" : "@octokit/rest@16.43.1" , "_inBundle" : false , "_integrity" : "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==" , "_location" : "/@octokit/rest" , "_phantomChildren" : { "@octokit/types" : "2.14.0" , "deprecation" : "2.3.1" , "once" : "1.4.0" } , "_requested" : { "type" : "version" , "registry" : true , "raw" : "@octokit/rest@16.43.1" , "name" : "@octokit/rest" , "escapedName" : "@octokit%2frest" , "scope" : "@octokit" , "rawSpec" : "16.43.1" , "saveSpec" : null , "fetchSpec" : "16.43.1" } , "_requiredBy" : [ "/@actions/github" ] , "_resolved" : "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz" , "_spec" : "16.43.1" , "_where" : "/workspaces/checkout" , "author" : { "name" : "Gregor Martynus" , "url" : "https://github.com/gr2m" } , "bugs" : { "url" : "https://github.com/octokit/rest.js/issues" } , "bundlesize" : [ { "path" : "./dist/octokit-rest.min.js.gz" , "maxSize" : "33 kB" } ] , "contributors" : [ { "name" : "Mike de Boer" , "email" : "info@mikedeboer.nl" } , { "name" : "Fabian Jakobs" , "email" : "fabian@c9.io" } , { "name" : "Joe Gallo" , "email" : "joe@brassafrax.com" } , { "name" : "Gregor Martynus" , "url" : "https://github.com/gr2m" } ] , "dependencies" : { "@octokit/auth-token" : "^2.4.0" , "@octokit/plugin-paginate-rest" : "^1.1.1" , "@octokit/plugin-request-log" : "^1.0.0" , "@octokit/plugin-rest-endpoint-methods" : "2.4.0" , "@octokit/request" : "^5.2.0" , "@octokit/request-error" : "^1.0.2" , "atob-lite" : "^2.0.0" , "before-after-hook" : "^2.0.0" , "btoa-lite" : "^1.0.0" , "deprecation" : "^2.0.0" , "lodash.get" : "^4.4.2" , "lodash.set" : "^4.3.2" , "lodash.uniq" : "^4.5.0" , "octokit-pagination-methods" : "^1.1.0" , "once" : "^1.4.0" , "universal-user-agent" : "^4.0.0" } , "de scription": "GitHub REST API client for Node.js" , "de vDependencies": { "@gimenete/type-writer" : "^0.1.3" , "@octokit/auth" : "^1.1.1" , "@octokit/fixtures-server" : "^5.0.6" , "@octokit/graphql" : "^4.2.0" , "@types/node" : "^13.1.0" , "bundlesize" : "^0.18.0" , "chai" : "^4.1.2" , "compression-webpack-plugin" : "^3.1.0" , "cypress" : "^3.0.0" , "glob" : "^7.1.2" , "http-proxy-agent" : "^4.0.0" , "lodash.camelcase" : "^4.3.0" , "lodash.merge" : "^4.6.1" , "lodash.upperfirst" : "^4.3.1" , "lolex" : "^5.1.2" , "mkdirp" : "^1.0.0" , "mocha" : "^7.0.1" , "mustache" : "^4.0.0" , "nock" : "^11.3.3" , "npm-run-all" : "^4.1.2" , "nyc" : "^15.0.0" , "prettier" : "^1.14.2" , "proxy" : "^1.0.0" , "semantic-release" : "^17.0.0" , "sinon" : "^8.0.0" , "sinon-chai" : "^3.0.0" , "sort-keys" : "^4.0.0" , "string-to-arraybuffer" : "^1.0.0" , "string-to-jsdoc-comment" : "^1.0.0" , "typescript" : "^3.3.1" , "webpack" : "^4.0.0" , "webpack-bundle-analyzer" : "^3.0.0" , "webpack-cli" : "^3.0.0" } , " files": [ "index.js" , "index.d.ts" , "lib" , "plugins" ] , "homepage" : "https://github.com/octokit/rest.js#readme" , "keywords" : [ "octokit" , "github" , "rest" , "api-client" ] , "license" : "MIT" , "name" : "@octokit/rest" , "nyc" : { "ignore" : [ "test" ] } , "publishConfig" : { "access" : "public" } , "release" : { "publish" : [ "@semantic-release/npm" , { "path" : "@semantic-release/github" , "assets" : [ "dist/*" , "!dist/*.map.gz" ] } ] } , "repository" : { "type" : "git" , "url" : "git+https://github.com/octokit/rest.js.git" } , "scripts" : { "build" : "npm-run-all build:* ", "build:browser" : "npm-run-all build:browser:*" , "build:browser:development" : "webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json" , "build:browser:production" : "webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map" , " build:ts": "npm run -s update-endpoints:typescript" , "coverage" : "nyc report --reporter=html && open coverage/index.html" , " generate-bundle-report": "webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html" , " lint": "prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json" , "lint:fix" : "prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json" , "postvalidate:ts" : "tsc --noEmit --target es6 test/typescript-validate.ts" , "prebuild:browser" : "mkdirp dist/" , "pretest" : "npm run -s lint" , "prevalidate:ts" : "npm run -s build: ts", "start-fixtures-server" : "octokit-fixtures-server" ,"test" : "nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"" , "test:browser" : "cypress run --browser chrome" , "update-endpoints" : "npm-run-all update-endpoints:*" , "update-endpoints:fetch-json" : "node scripts/update-endpoints/fetch-json" , "update-endpoints:typescript" : "node scripts/update-endpoints/typescript" , "validate:ts" : "tsc --target es6 --noImplicitAny index.d.ts" } , "types" : "index.d.ts" , "version" : "16.43.1" } ;
/***/ } ) ,
@ -16397,6 +16448,25 @@ module.exports = require("util");
"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 ) {
@ -16408,9 +16478,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
} ;
var _a ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const assert _1 = _ _webpack _require _ _ ( 357 ) ;
const fs = _ _ webpack_require _ _ ( 747 ) ;
const path = _ _ webpack_require _ _ ( 622 ) ;
exports . getCmdPath = exports . tryGetExecutablePath = exports . isRooted = exports . isDirectory = exports . exists = exports . IS _WINDOWS = exports . unlink = exports . symlink = exports . stat = exports . rmdir = exports . rename = exports . readlink = exports . readdir = exports . mkdir = exports . lstat = exports . copyFile = exports . chmod = void 0 ;
const fs = _ _ importStar( _ _ webpack_require _ _ ( 747 ) ) ;
const path = _ _ importStar( _ _ webpack_require _ _ ( 622 ) ) ;
_a = fs . promises , exports . chmod = _a . chmod , exports . copyFile = _a . copyFile , exports . lstat = _a . lstat , exports . mkdir = _a . mkdir , exports . readdir = _a . readdir , exports . readlink = _a . readlink , exports . rename = _a . rename , exports . rmdir = _a . rmdir , exports . stat = _a . stat , exports . symlink = _a . symlink , exports . unlink = _a . unlink ;
exports . IS _WINDOWS = process . platform === 'win32' ;
function exists ( fsPath ) {
@ -16451,49 +16521,6 @@ function isRooted(p) {
return p . startsWith ( '/' ) ;
}
exports . isRooted = isRooted ;
/ * *
* Recursively create a directory at ` fsPath ` .
*
* This implementation is optimistic , meaning it attempts to create the full
* path first , and backs up the path stack from there .
*
* @ param fsPath The path to create
* @ param maxDepth The maximum recursion depth
* @ param depth The current recursion depth
* /
function mkdirP ( fsPath , maxDepth = 1000 , depth = 1 ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
assert _1 . ok ( fsPath , 'a path argument must be provided' ) ;
fsPath = path . resolve ( fsPath ) ;
if ( depth >= maxDepth )
return exports . mkdir ( fsPath ) ;
try {
yield exports . mkdir ( fsPath ) ;
return ;
}
catch ( err ) {
switch ( err . code ) {
case 'ENOENT' : {
yield mkdirP ( path . dirname ( fsPath ) , maxDepth , depth + 1 ) ;
yield exports . mkdir ( fsPath ) ;
return ;
}
default : {
let stats ;
try {
stats = yield exports . stat ( fsPath ) ;
}
catch ( err2 ) {
throw err ;
}
if ( ! stats . isDirectory ( ) )
throw err ;
}
}
}
} ) ;
}
exports . mkdirP = mkdirP ;
/ * *
* Best effort attempt to determine whether a file exists and is executable .
* @ param filePath file path to check
@ -16590,6 +16617,12 @@ function isUnixExecutable(stats) {
( ( stats . mode & 8 ) > 0 && stats . gid === process . getgid ( ) ) ||
( ( stats . mode & 64 ) > 0 && stats . uid === process . getuid ( ) ) ) ;
}
// Get the path of cmd.exe in windows
function getCmdPath ( ) {
var _a ;
return ( _a = process . env [ 'COMSPEC' ] ) !== null && _a !== void 0 ? _a : ` cmd.exe ` ;
}
exports . getCmdPath = getCmdPath ;
//# sourceMappingURL=io-util.js.map
/***/ } ) ,