setup-cpp/dist/main.js

3 lines
114 KiB
JavaScript
Raw Normal View History

2021-09-17 19:32:46 +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)}))}))}be(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 _e)return{binDir:_e};const s=e(ge).sync("brew",{nothrow:!0});return null!==s?(_e=ee.dirname(s),{binDir:_e}):(re.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),_e="/usr/local/bin/",{binDir:_e})}function s(e,t,r){return Ie(this,void 0,void 0,(function*(){const o=Ne.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 Ne.ToolRunner(s,t,r).exec()}))}function n(e){return void 0!==Le||(Le=!!process.env.CI||0===(null===(t=process.getuid)||void 0===t?void 0:t.call(process))),Le?"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 Re.exec(n("add-apt-repository"),["--update",r])),De&&!0!==r||(await Re.exec(o,["update"]),De=!0),void 0!==t&&""!==t)try{s=await Re.exec(o,["install",`${e}=${t}`])}catch{s=await Re.exec(o,["install",`${e}-${t}`])}else s=await Re.exec(o,["install",e]);if(0!==s)throw Error(`Failed to install ${e} ${t}`);return{binDir:"/usr/bin/"}}function a(t,r){return je&&null!==e(ge).sync("brew",{nothrow:!0})||(o(0,0,process),je=!0),re.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 Fe)return{binDir:Fe};const s=e(ge).sync("choco",{nothrow:!0});if(null!==s)return Fe=ee.dirname(s),{binDir:Fe};if(0!==await Re.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(ge).sync("choco",{nothrow:!0});return Fe=null!==n?ee.dirname(n):"C:/ProgramData/Chocolatey/bin/",te.existsSync(Fe)?{binDir:Fe}:void 0}async function c(t,r,o=[]){let s;if(ke&&null!==e(ge).sync("choco",{nothrow:!0})||(await l(0,0,process),ke=!0),s=void 0!==r&&""!==r?await Re.exec("choco",["install","-y",t,"--version="+r,...o]):await Re.exec("choco",["install","-y",t,...o]),0!==s)throw Error(`Failed to install ${t} ${r}`);const n="C:/ProgramData/Chocolatey/bin/";return xe.addPath(n),{binDir:n}}function u(e,t){const r=[];t=t||ze.arch();const o=We.join(v(),e);if(Ye.existsSync(o)){const e=Ye.readdirSync(o);for(const s of e)if(f(s)){const e=We.join(o,s,t||"");Ye.existsSync(e)&&Ye.existsSync(e+".complete")&&r.push(s)}}return r}function p(e){return Ge(this,void 0,void 0,(function*(){return e||(e=We.join(y(),tt.default())),yield Xe.mkdirP(e),e}))}function d(e,t,r){return Ge(this,void 0,void 0,(function*(){const o=We.join(v(),e,Ke.clean(t)||t,r||"");Be.debug("destination "+o);const s=o+".complete";return yield Xe.rmRF(o),yield Xe.rmRF(s),yield Xe.mkdirP(o),o}))}function h(e,t,r){const o=We.join(v(),e,Ke.clean(t)||t,r||"");Ye.writeFileSync(o+".complete",""),Be.debug("finished caching tool")}function f(e){const t=Ke.clean(e)||"";Be.debug("isExplicit: "+t);const r=null!=Ke.valid(t);return Be.debug("explicit? "+r),r}function m(e,t){let r="";Be.debug(`evaluating ${e.length} versions`);for(let o=(e=e.sort(((e,t)=>Ke.gt(e,t)?1:-1))).length-1;o>=0;o--){const s=e[o];if(Ke.satisfies(s,t)){r=s;break}}return Be.debug(r?"matched: "+r:"match not found"),r}function v(){const e=process.env.RUNNER_TOOL_CACHE||"";return ie.ok(e,"Expected RUNNER_TOOL_CACHE to be
//# sourceMappingURL=main.js.map