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
151 KiB
JavaScript
Raw Normal View History

2022-03-02 06:01:08 +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 pt(this,void 0,void 0,(function*(){const n=dt.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 dt.ToolRunner(o,t,r).exec()}))}function n(e,t){const r=[];t=t||et.arch();const n=tt.join(c(),e);if(Ze.existsSync(n)){const e=Ze.readdirSync(n);for(const o of e)if(a(o)){const e=tt.join(n,o,t||"");Ze.existsSync(e)&&Ze.existsSync(e+".complete")&&r.push(o)}}return r}function o(e){return ze(this,void 0,void 0,(function*(){return e||(e=tt.join(u(),st.default())),yield Je.mkdirP(e),e}))}function i(e,t,r){return ze(this,void 0,void 0,(function*(){const n=tt.join(c(),e,nt.clean(t)||t,r||"");Ye.debug("destination "+n);const o=n+".complete";return yield Je.rmRF(n),yield Je.rmRF(o),yield Je.mkdirP(n),n}))}function s(e,t,r){const n=tt.join(c(),e,nt.clean(t)||t,r||"");Ze.writeFileSync(n+".complete",""),Ye.debug("finished caching tool")}function a(e){const t=nt.clean(e)||"";Ye.debug("isExplicit: "+t);const r=null!=nt.valid(t);return Ye.debug("explicit? "+r),r}function l(e,t){let r="";Ye.debug(`evaluating ${e.length} versions`);for(let n=(e=e.sort(((e,t)=>nt.gt(e,t)?1:-1))).length-1;n>=0;n--){const o=e[n];if(nt.satisfies(o,t)){r=o;break}}return Ye.debug(r?"matched: "+r:"match not found"),r}function c(){const e=process.env.RUNNER_TOOL_CACHE||"";return Re.ok(e,"Expected RUNNER_TOOL_CACHE to be defined"),e}function u(){const e=process.env.RUNNER_TEMP||"";return Re.ok(e,"Expected RUNNER_TEMP to be defined"),e}function p(e,t){const r=Ue[e];return void 0!==r?r:t}function d(){return"true"===process.env.CI&&"true"===process.env.GITHUB_ACTIONS}function h(e){return d()?Et.error(e):console.log(`${e}`)}function f(e){return d()?Et.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)}))}))}_t(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 Rt)return{binDir:Rt};const o=t(St).sync("brew",{nothrow:!0});return null!==o?(Rt=Oe.dirname(o),{binDir:Rt}):(Ne.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Rt="/usr/local/bin/",{binDir:Rt})}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=St.sync(e.command,{path:r[Dt({env:r})],pathExt:t?Oe.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=Oe.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 Wt&&1===e&&!t.file?y(t.original,"spawn"):null}function w(e,t,r){const n=kt(e,t,r),o=Ne.spawn(n.command,n.args,n.options);return Bt.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=Hr(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Br.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Xr(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new zr)}))})),n.getBufferedValue()}function E(){var e;return void 0!==yn||(yn=(!!process.env.CI||0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process)))&&null!==t(St).sync("sudo",{nothrow:!0})),yn}function S(e,r,n){return E()?t(Nt).command("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),{shell:!0,cwd:n,stdio:"inherit"}):t(Nt)(e,r,{stdio:"inherit"})}async function P(e,t,r=!0){Et.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