Template
1
0
mirror of https://github.com/aminya/setup-cpp synced 2024-11-30 21:22:30 +08:00
setup-cpp/dist/setup_cpp.js

3 lines
152 KiB
JavaScript
Raw Normal View History

2022-04-18 17:31:21 +08:00
function e(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function t(e){return e&&e.__esModule?e.default:e}function r(e,t,r){return ht(this,void 0,void 0,(function*(){const n=ft.argStringToArray(e);if(0===n.length)throw Error("Parameter 'commandLine' cannot be null or empty.");const o=n[0];return t=n.slice(1).concat(t||[]),new ft.ToolRunner(o,t,r).exec()}))}function n(e,t){const r=[];t=t||rt.arch();const n=nt.join(l(),e);if(et.existsSync(n)){const e=et.readdirSync(n);for(const o of e)if(a(o)){const e=nt.join(n,o,t||"");et.existsSync(e)&&et.existsSync(e+".complete")&&r.push(o)}}return r}function o(e){return Je(this,void 0,void 0,(function*(){return e||(e=nt.join(u(),ct.default())),yield Qe.mkdirP(e),e}))}function i(e,t,r){return Je(this,void 0,void 0,(function*(){const n=nt.join(l(),e,it.clean(t)||t,r||"");Ze.debug("destination "+n);const o=n+".complete";return yield Qe.rmRF(n),yield Qe.rmRF(o),yield Qe.mkdirP(n),n}))}function s(e,t,r){const n=nt.join(l(),e,it.clean(t)||t,r||"");et.writeFileSync(n+".complete",""),Ze.debug("finished caching tool")}function a(e){const t=it.clean(e)||"";Ze.debug("isExplicit: "+t);const r=null!=it.valid(t);return Ze.debug("explicit? "+r),r}function c(e,t){let r="";Ze.debug(`evaluating ${e.length} versions`);for(let n=(e=e.sort(((e,t)=>it.gt(e,t)?1:-1))).length-1;n>=0;n--){const o=e[n];if(it.satisfies(o,t)){r=o;break}}return Ze.debug(r?"matched: "+r:"match not found"),r}function l(){const e=process.env.RUNNER_TOOL_CACHE||"";return Ne.ok(e,"Expected RUNNER_TOOL_CACHE to be defined"),e}function u(){const e=process.env.RUNNER_TEMP||"";return Ne.ok(e,"Expected RUNNER_TEMP to be defined"),e}function p(e,t){const r=qe[e];return void 0!==r?r:t}function d(){return"true"===process.env.CI&&"true"===process.env.GITHUB_ACTIONS}function h(e){return d()?Pt.error(e):console.log(`${e}`)}function f(e){return d()?Pt.warning(e):console.log(`${e}`)}function m(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise(((r,n)=>{m(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}It(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function v(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof Nt)return{binDir:Nt};const o=t(Ot).sync("brew",{nothrow:!0});return null!==o?(Nt=$e.dirname(o),{binDir:Nt}):(De.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Nt="/usr/local/bin/",{binDir:Nt})}function g(e,t){const r=e.options.env||process.env,n=process.cwd(),o=null!=e.options.cwd,i=o&&void 0!==process.chdir&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch(e){}let s;try{s=Ot.sync(e.command,{path:r[Ft({env:r})],pathExt:t?$e.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=$e.resolve(o?e.options.cwd:"",s)),s}function y(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function x(e,t){return zt&&1===e&&!t.file?y(t.original,"spawn"):null}function w(e,t,r){const n=jt(e,t,r),o=De.spawn(n.command,n.args,n.options);return Xt.hookChildProcess(o,n),o}async function b(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Br(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Xr.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Yr(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Jr)}))})),n.getBufferedValue()}function E(){var e;return void 0!==wn||(wn=(!!process.env.CI||0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process)))&&null!==t(Ot).sync("sudo",{nothrow:!0})),wn}function S(e,r,n){return E()?t(Dt).command("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),{shell:!0,cwd:n,stdio:"inherit"}):t(Dt)(e,r,{stdio:"inherit"})}async function P(e,t,r=!0){Pt.info(`Installing ${e} ${null!=t?t:""} via apt`);const n="apt-get";
2021-09-18 04:00:26 +08:00
//# sourceMappingURL=setup_cpp.js.map