unity-builder/action/index.js

1 line
7.9 MiB
JavaScript
Raw Normal View History

2021-02-12 21:42:47 +00:00
module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var i=r[t]={i:t,l:false,exports:{}};e[t].call(i.exports,i,i.exports,__webpack_require__);i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(2492)}t(__webpack_require__);return startup()}({1:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,a){function fulfilled(e){try{step(i.next(e))}catch(e){a(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){a(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});const a=r(3129);const s=r(5622);const n=r(1669);const o=r(3672);const u=n.promisify(a.exec);function cp(e,t,r={}){return i(this,void 0,void 0,function*(){const{force:i,recursive:a}=readCopyOptions(r);const n=(yield o.exists(t))?yield o.stat(t):null;if(n&&n.isFile()&&!i){return}const u=n&&n.isDirectory()?s.join(t,s.basename(e)):t;if(!(yield o.exists(e))){throw new Error(`no such file or directory: ${e}`)}const p=yield o.stat(e);if(p.isDirectory()){if(!a){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,u,0,i)}}else{if(s.relative(e,u)===""){throw new Error(`'${u}' and '${e}' are the same file`)}yield copyFile(e,u,i)}})}t.cp=cp;function mv(e,t,r={}){return i(this,void 0,void 0,function*(){if(yield o.exists(t)){let i=true;if(yield o.isDirectory(t)){t=s.join(t,s.basename(e));i=yield o.exists(t)}if(i){if(r.force==null||r.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(s.dirname(t));yield o.rename(e,t)})}t.mv=mv;function rmRF(e){return i(this,void 0,void 0,function*(){if(o.IS_WINDOWS){try{if(yield o.isDirectory(e,true)){yield u(`rd /s /q "${e}"`)}else{yield u(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield o.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield o.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield u(`rm -rf "${e}"`)}else{yield o.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return i(this,void 0,void 0,function*(){yield o.mkdirP(e)})}t.mkdirP=mkdirP;function which(e,t){return i(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(o.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.`)}}}try{const t=[];if(o.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(s.delimiter)){if(e){t.push(e)}}}if(o.isRooted(e)){const r=yield o.tryGetExecutablePath(e,t);if(r){return r}return""}if(e.includes("/")||o.IS_WINDOWS&&e.includes("\\")){return""}const r=[];if(process.env.PATH){for(const e of process.env.PATH.split(s.delimiter)){if(e){r.push(e)}}}for(const i of r){const r=yield o.tryGetExecutablePath(i+s.sep+e,t);if(r){return r}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}t.which=which;function readCopyOptions(e){const t=e.force==null?true:e.force;const r=Boolean(e.recursive);return{force:t,recursive:r}}function cpDirRecursive(e,t,r,a){return i(this,void 0,void 0,function*(){if(r>=255)return;r++;yield mkdirP(t);const i=yield o.readdir(e);for(const s of i){const i=`${e}/${s}`;const n=`${t}/${s}`;const u=yield o.lstat(i);if(u.isDirectory()){yield cpDirRecursive(i,n,r,a)}else{yield copyFile(i,n,a)}}yield o.chmod(t,(yield o.stat(e)).mode)})}function copyFil