toolchain/dist/index.js

1 line
1.7 MiB
JavaScript
Raw Normal View History

module.exports=function(e,t){"use strict";var a={};function __webpack_require__(t){if(a[t]){return a[t].exports}var i=a[t]={i:t,l:false,exports:{}};var n=true;try{e[t].call(i.exports,i,i.exports,__webpack_require__);n=false}finally{if(n)delete a[t]}i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(131)}return startup()}([,function(e,t,a){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,a,i){if(i===undefined)i=a;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[a]}})}:function(e,t,a,i){if(i===undefined)i=a;e[i]=t[a]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var a in e)if(a!=="default"&&Object.hasOwnProperty.call(e,a))i(t,e,a);n(t,e);return t};var o=this&&this.__awaiter||function(e,t,a,i){function adopt(e){return e instanceof a?e:new a(function(t){t(e)})}return new(a||(a=Promise))(function(a,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.findInPath=t.which=t.mkdirP=t.rmRF=t.mv=t.cp=void 0;const s=a(357);const p=r(a(129));const c=r(a(622));const l=a(669);const u=r(a(672));const d=l.promisify(p.exec);const m=l.promisify(p.execFile);function cp(e,t,a={}){return o(this,void 0,void 0,function*(){const{force:i,recursive:n,copySourceDirectory:r}=readCopyOptions(a);const o=(yield u.exists(t))?yield u.stat(t):null;if(o&&o.isFile()&&!i){return}const s=o&&o.isDirectory()&&r?c.join(t,c.basename(e)):t;if(!(yield u.exists(e))){throw new Error(`no such file or directory: ${e}`)}const p=yield u.stat(e);if(p.isDirectory()){if(!n){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,s,0,i)}}else{if(c.relative(e,s)===""){throw new Error(`'${s}' and '${e}' are the same file`)}yield copyFile(e,s,i)}})}t.cp=cp;function mv(e,t,a={}){return o(this,void 0,void 0,function*(){if(yield u.exists(t)){let i=true;if(yield u.isDirectory(t)){t=c.join(t,c.basename(e));i=yield u.exists(t)}if(i){if(a.force==null||a.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(c.dirname(t));yield u.rename(e,t)})}t.mv=mv;function rmRF(e){return o(this,void 0,void 0,function*(){if(u.IS_WINDOWS){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}try{const t=u.getCmdPath();if(yield u.isDirectory(e,true)){yield d(`${t} /s /c "rd /s /q "%inputPath%""`,{env:{inputPath:e}})}else{yield d(`${t} /s /c "del /f /a "%inputPath%""`,{env:{inputPath:e}})}}catch(e){if(e.code!=="ENOENT")throw e}try{yield u.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield u.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield m(`rm`,[`-rf`,`${e}`])}else{yield u.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return o(this,void 0,void 0,function*(){s.ok(e,"a path argument must be provided");yield u.mkdir(e,{recursive:true})})}t.mkdirP=mkdirP;function which(e,t){return o(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(u.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. 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 t}const a=yield findInPath(e);if(a&&a.len