2021-09-18 02:09:00 +08:00
|
|
|
function e(e){return e&&e.__esModule?e.default:e}function t(e,t,r,o){Object.defineProperty(e,t,{get:r,set:o,enumerable:!0,configurable:!0})}function r(e,t,o){if("function"==typeof t&&(o=t,t={}),!o){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise(((o,s)=>{r(e,t||{},((e,t)=>{e?s(e):o(t)}))}))}Oe(e,t||{},((e,r)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),o(e,r)}))}function o(t,r,o){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof Ae)return{binDir:Ae};const s=e(we).sync("brew",{nothrow:!0});return null!==s?(Ae=re.dirname(s),{binDir:Ae}):(se.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Ae="/usr/local/bin/",{binDir:Ae})}function s(e,t,r){return Le(this,void 0,void 0,(function*(){const o=De.argStringToArray(e);if(0===o.length)throw Error("Parameter 'commandLine' cannot be null or empty.");const s=o[0];return t=o.slice(1).concat(t||[]),new De.ToolRunner(s,t,r).exec()}))}function n(e){return void 0!==je||(je=!!process.env.CI||0===(null===(t=process.getuid)||void 0===t?void 0:t.call(process))),je?"sudo "+e:e;var t}async function i(e,t,r=!0){const o=n("apt-get");let s=0;if("string"==typeof r&&(s=await Ce.exec(n("add-apt-repository"),["--update",r])),ke&&!0!==r||(await Ce.exec(o,["update"]),ke=!0),void 0!==t&&""!==t)try{s=await Ce.exec(o,["install",`${e}=${t}`])}catch{s=await Ce.exec(o,["install",`${e}-${t}`])}else s=await Ce.exec(o,["install",e]);if(0!==s)throw Error(`Failed to install ${e} ${t}`);return{binDir:"/usr/bin/"}}function a(t,r){return Fe&&null!==e(we).sync("brew",{nothrow:!0})||(o(0,0,process),Fe=!0),se.execFileSync("brew",["install",void 0!==r&&""!==r?`${t}@${r}`:t],{stdio:"inherit"}),{binDir:"/usr/local/bin/"}}async function l(t,r,o){if("win32"!==process.platform)return;if("string"==typeof Me)return{binDir:Me};const s=e(we).sync("choco",{nothrow:!0});if(null!==s)return Me=re.dirname(s),{binDir:Me};if(0!==await Ce.exec('@"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString(\'https://community.chocolatey.org/install.ps1\'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\\chocolatey\\bin"'))throw Error("Failed to install chocolatey");const n=e(we).sync("choco",{nothrow:!0});return Me=null!==n?re.dirname(n):"C:/ProgramData/Chocolatey/bin/",oe.existsSync(Me)?{binDir:Me}:void 0}async function c(t,r,o=[]){let s;if(Ue&&null!==e(we).sync("choco",{nothrow:!0})||(await l(0,0,process),Ue=!0),s=void 0!==r&&""!==r?await Ce.exec("choco",["install","-y",t,"--version="+r,...o]):await Ce.exec("choco",["install","-y",t,...o]),0!==s)throw Error(`Failed to install ${t} ${r}`);const n="C:/ProgramData/Chocolatey/bin/";return Ee.addPath(n),{binDir:n}}function u(e,t){const r=[];t=t||Je.arch();const o=Ke.join(v(),e);if(ze.existsSync(o)){const e=ze.readdirSync(o);for(const s of e)if(f(s)){const e=Ke.join(o,s,t||"");ze.existsSync(e)&&ze.existsSync(e+".complete")&&r.push(s)}}return r}function p(e){return He(this,void 0,void 0,(function*(){return e||(e=Ke.join(g(),ot.default())),yield Ze.mkdirP(e),e}))}function h(e,t,r){return He(this,void 0,void 0,(function*(){const o=Ke.join(v(),e,et.clean(t)||t,r||"");Ye.debug("destination "+o);const s=o+".complete";return yield Ze.rmRF(o),yield Ze.rmRF(s),yield Ze.mkdirP(o),o}))}function d(e,t,r){const o=Ke.join(v(),e,et.clean(t)||t,r||"");ze.writeFileSync(o+".complete",""),Ye.debug("finished caching tool")}function f(e){const t=et.clean(e)||"";Ye.debug("isExplicit: "+t);const r=null!=et.valid(t);return Ye.debug("explicit? "+r),r}function m(e,t){let r="";Ye.debug(`evaluating ${e.length} versions`);for(let o=(e=e.sort(((e,t)=>et.gt(e,t)?1:-1))).length-1;o>=0;o--){const s=e[o];if(et.satisfies(s,t)){r=s;break}}return Ye.debug(r?"matched: "+r:"match not found"),r}function v(){const e=process.env.RUNNER_TOOL_CACHE||"";return le.ok(e,"Expected RUNNER_TOOL_CACHE to be
|