2021-09-18 02:19:10 +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)}))}))}ye(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 Pe)return{binDir:Pe};const s=e(fe).sync("brew",{nothrow:!0});return null!==s?(Pe=W.dirname(s),{binDir:Pe}):(K.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Pe="/usr/local/bin/",{binDir:Pe})}function s(e,t,r){return Re(this,void 0,void 0,(function*(){const o=Ce.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 Ce.ToolRunner(s,t,r).exec()}))}function n(e){return void 0!==Ae||(Ae=!!process.env.CI||0===(null===(t=process.getuid)||void 0===t?void 0:t.call(process))),Ae?"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 Oe.exec(n("add-apt-repository"),["--update",r])),Te&&!0!==r||(await Oe.exec(o,["update"]),Te=!0),void 0!==t&&""!==t)try{s=await Oe.exec(o,["install",`${e}=${t}`])}catch{s=await Oe.exec(o,["install",`${e}-${t}`])}else s=await Oe.exec(o,["install",e]);if(0!==s)throw Error(`Failed to install ${e} ${t}`);return{binDir:"/usr/bin/"}}function a(t,r){return Ie&&null!==e(fe).sync("brew",{nothrow:!0})||(o(0,0,process),Ie=!0),K.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 Ne)return{binDir:Ne};const s=e(fe).sync("choco",{nothrow:!0});if(null!==s)return Ne=W.dirname(s),{binDir:Ne};if(0!==await Oe.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(fe).sync("choco",{nothrow:!0});return Ne=null!==n?W.dirname(n):"C:/ProgramData/Chocolatey/bin/",J.existsSync(Ne)?{binDir:Ne}:void 0}async function c(t,r,o=[]){let s;if(De&&null!==e(fe).sync("choco",{nothrow:!0})||(await l(0,0,process),De=!0),s=void 0!==r&&""!==r?await Oe.exec("choco",["install","-y",t,"--version="+r,...o]):await Oe.exec("choco",["install","-y",t,...o]),0!==s)throw Error(`Failed to install ${t} ${r}`);const n="C:/ProgramData/Chocolatey/bin/";return me.addPath(n),{binDir:n}}function u(e,t){const r=[];t=t||He.arch();const o=Xe.join(v(),e);if(Ge.existsSync(o)){const e=Ge.readdirSync(o);for(const s of e)if(f(s)){const e=Xe.join(o,s,t||"");Ge.existsSync(e)&&Ge.existsSync(e+".complete")&&r.push(s)}}return r}function p(e){return Me(this,void 0,void 0,(function*(){return e||(e=Xe.join(g(),Je.default())),yield qe.mkdirP(e),e}))}function h(e,t,r){return Me(this,void 0,void 0,(function*(){const o=Xe.join(v(),e,Ze.clean(t)||t,r||"");Ve.debug("destination "+o);const s=o+".complete";return yield qe.rmRF(o),yield qe.rmRF(s),yield qe.mkdirP(o),o}))}function d(e,t,r){const o=Xe.join(v(),e,Ze.clean(t)||t,r||"");Ge.writeFileSync(o+".complete",""),Ve.debug("finished caching tool")}function f(e){const t=Ze.clean(e)||"";Ve.debug("isExplicit: "+t);const r=null!=Ze.valid(t);return Ve.debug("explicit? "+r),r}function m(e,t){let r="";Ve.debug(`evaluating ${e.length} versions`);for(let o=(e=e.sort(((e,t)=>Ze.gt(e,t)?1:-1))).length-1;o>=0;o--){const s=e[o];if(Ze.satisfies(s,t)){r=s;break}}return Ve.debug(r?"matched: "+r:"match not found"),r}function v(){const e=process.env.RUNNER_TOOL_CACHE||"";return re.ok(e,"Expected RUNNER_TOOL_CACHE to be defin
|