setup-cpp/dist/setup_cpp.js

3 lines
159 KiB
JavaScript
Raw Normal View History

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 mt(this,void 0,void 0,(function*(){const n=vt.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 vt.ToolRunner(o,t,r).exec()}))}function n(e,t){const r=[];t=t||ot.arch();const n=it.join(l(),e);if(rt.existsSync(n)){const e=rt.readdirSync(n);for(const o of e)if(a(o)){const e=it.join(n,o,t||"");rt.existsSync(e)&&rt.existsSync(e+".complete")&&r.push(o)}}return r}function o(e){return Ze(this,void 0,void 0,(function*(){return e||(e=it.join(u(),ut.default())),yield tt.mkdirP(e),e}))}function i(e,t,r){return Ze(this,void 0,void 0,(function*(){const n=it.join(l(),e,at.clean(t)||t,r||"");et.debug("destination "+n);const o=n+".complete";return yield tt.rmRF(n),yield tt.rmRF(o),yield tt.mkdirP(n),n}))}function s(e,t,r){const n=it.join(l(),e,at.clean(t)||t,r||"");rt.writeFileSync(n+".complete",""),et.debug("finished caching tool")}function a(e){const t=at.clean(e)||"";et.debug("isExplicit: "+t);const r=null!=at.valid(t);return et.debug("explicit? "+r),r}function c(e,t){let r="";et.debug(`evaluating ${e.length} versions`);for(let n=(e=e.sort(((e,t)=>at.gt(e,t)?1:-1))).length-1;n>=0;n--){const o=e[n];if(at.satisfies(o,t)){r=o;break}}return et.debug(r?"matched: "+r:"match not found"),r}function l(){const e=process.env.RUNNER_TOOL_CACHE||"";return Le.ok(e,"Expected RUNNER_TOOL_CACHE to be defined"),e}function u(){const e=process.env.RUNNER_TEMP||"";return Le.ok(e,"Expected RUNNER_TEMP to be defined"),e}function d(e,t){const r=ze[e];return void 0!==r?r:t}function p(){return"true"===process.env.CI&&"true"===process.env.GITHUB_ACTIONS}function h(e){return p()?Pt.error(e):console.log(`${e}`)}function f(e){return p()?Pt.warning(e):console.log(`${e}`)}function m(e){return p()?Pt.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 Lt)return{binDir:Lt};const o=t($t).sync("brew",{nothrow:!0});return null!==o?(Lt=Ie.dirname(o),{binDir:Lt}):(je.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Lt="/usr/local/bin/",{binDir:Lt})}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[Ut({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 Jt&&1===e&&!t.file?w(t.original,"spawn"):null}function b(e,t,r){const n=Mt(e,t,r),o=je.spawn(n.command,n.args,n.options);return Yt.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()<=Yr.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Kr(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Zr)}))})),n.getBufferedValue()}function S(){var e;return void 0!==En||(En=(!!process.env.CI||0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process)))&&null!==t($t).sync("sudo",{nothrow:!0})),En}function O(e,r,n){return S()?t(jt).command("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),{shell:!0,cwd:n,stdio:"inherit"}):t(jt)(e,r,{stdio:"inherit"})}function _(e){return S()&&"string"==typeof pr
2021-09-18 04:00:26 +08:00
//# sourceMappingURL=setup_cpp.js.map