setup-cpp/dist/setup_cpp.js

3 lines
158 KiB
JavaScript
Raw Normal View History

2022-04-18 18:48:12 +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 ft(this,void 0,void 0,(function*(){const n=mt.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 mt.ToolRunner(o,t,r).exec()}))}function n(e,t){const r=[];t=t||nt.arch();const n=ot.join(l(),e);if(tt.existsSync(n)){const e=tt.readdirSync(n);for(const o of e)if(a(o)){const e=ot.join(n,o,t||"");tt.existsSync(e)&&tt.existsSync(e+".complete")&&r.push(o)}}return r}function o(e){return Ke(this,void 0,void 0,(function*(){return e||(e=ot.join(u(),lt.default())),yield et.mkdirP(e),e}))}function i(e,t,r){return Ke(this,void 0,void 0,(function*(){const n=ot.join(l(),e,st.clean(t)||t,r||"");Qe.debug("destination "+n);const o=n+".complete";return yield et.rmRF(n),yield et.rmRF(o),yield et.mkdirP(n),n}))}function s(e,t,r){const n=ot.join(l(),e,st.clean(t)||t,r||"");tt.writeFileSync(n+".complete",""),Qe.debug("finished caching tool")}function a(e){const t=st.clean(e)||"";Qe.debug("isExplicit: "+t);const r=null!=st.valid(t);return Qe.debug("explicit? "+r),r}function c(e,t){let r="";Qe.debug(`evaluating ${e.length} versions`);for(let n=(e=e.sort(((e,t)=>st.gt(e,t)?1:-1))).length-1;n>=0;n--){const o=e[n];if(st.satisfies(o,t)){r=o;break}}return Qe.debug(r?"matched: "+r:"match not found"),r}function l(){const e=process.env.RUNNER_TOOL_CACHE||"";return De.ok(e,"Expected RUNNER_TOOL_CACHE to be defined"),e}function u(){const e=process.env.RUNNER_TEMP||"";return De.ok(e,"Expected RUNNER_TEMP to be defined"),e}function p(e,t){const r=Ve[e];return void 0!==r?r:t}function d(){return"true"===process.env.CI&&"true"===process.env.GITHUB_ACTIONS}function h(e){return d()?Ot.error(e):console.log(`${e}`)}function f(e){return d()?Ot.warning(e):console.log(`${e}`)}function m(e){return d()?Ot.info(e):console.log(e)}function v(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)=>{v(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}Ct(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function g(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof Dt)return{binDir:Dt};const o=t(_t).sync("brew",{nothrow:!0});return null!==o?(Dt=Ie.dirname(o),{binDir:Dt}):(Le.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Dt="/usr/local/bin/",{binDir:Dt})}function y(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=_t.sync(e.command,{path:r[Ft({env:r})],pathExt:t?Ie.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=Ie.resolve(o?e.options.cwd:"",s)),s}function w(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 Yt&&1===e&&!t.file?w(t.original,"spawn"):null}function b(e,t,r){const n=jt(e,t,r),o=Le.spawn(n.command,n.args,n.options);return zt.hookChildProcess(o,n),o}async function E(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Wr(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=zr.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Jr(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Kr)}))})),n.getBufferedValue()}function S(){var e;return void 0!==bn||(bn=(!!process.env.CI||0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process)))&&null!==t(_t).sync("sudo",{nothrow:!0})),bn}function $(e,r,n){return S()?t(Lt).command("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),{shell:!0,cwd:n,stdio:"inherit"}):t(Lt)(e,r,{stdio:"inherit"})}async function O(e,t,r=!0){Ot.info(`Installin
2021-09-18 04:00:26 +08:00
//# sourceMappingURL=setup_cpp.js.map