setup-cpp/dist/setup_cpp.js

3 lines
152 KiB
JavaScript
Raw Normal View History

function e(e){return e&&e.__esModule?e.default:e}function t(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function r(e,t,r){const n=new tt(e,t,r);process.stdout.write(""+n+Qe.EOL)}function n(e,t){const r=process.env["INPUT_"+e.replace(/ /g,"_").toUpperCase()]||"";if(t&&t.required&&!r)throw Error("Input required and not supplied: "+e);return t&&!1===t.trimWhitespace?r:r.trim()}function o(e,t={}){Ye.issueCommand("error",et.toCommandProperties(t),e instanceof Error?""+e:e)}function s(e){Ye.issue("group",e)}function i(){Ye.issue("endgroup")}function a(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)=>{a(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}wt(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function c(t,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof Ot)return{binDir:Ot};const o=e(gt).sync("brew",{nothrow:!0});return null!==o?(Ot=Pe.dirname(o),{binDir:Ot}):(Ne.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Ot="/usr/local/bin/",{binDir:Ot})}function l(e,t){const r=e.options.env||process.env,n=process.cwd(),o=null!=e.options.cwd,s=o&&void 0!==process.chdir&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch(e){}let i;try{i=gt.sync(e.command,{path:r[It({env:r})],pathExt:t?Pe.delimiter:void 0})}catch(e){}finally{s&&process.chdir(n)}return i&&(i=Pe.resolve(o?e.options.cwd:"",i)),i}function u(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 p(e,t){return Ut&&1===e&&!t.file?u(t.original,"spawn"):null}function d(e,t,r){const n=$t(e,t,r),o=Ne.spawn(n.command,n.args,n.options);return Mt.hookChildProcess(o,n),o}function h(){yr&&(yr=!1,fr.forEach((e=>{try{process.removeListener(e,gr[e])}catch(e){}})),process.emit=wr,process.reallyExit=xr,hr.count-=1)}function f(e,t,r){hr.emitted[e]||(hr.emitted[e]=!0,hr.emit(e,t,r))}function m(){yr||(yr=!0,hr.count+=1,fr=fr.filter((e=>{try{return process.on(e,gr[e]),!0}catch(e){return!1}})),process.emit=g,process.reallyExit=v)}function v(e){process.exitCode=e||0,f("exit",process.exitCode,null),f("afterexit",process.exitCode,null),xr.call(process,process.exitCode)}function g(e,t){if("exit"===e){void 0!==t&&(process.exitCode=t);var r=wr.apply(this,arguments);return f("exit",process.exitCode,null),f("afterexit",process.exitCode,null),r}return wr.apply(this,arguments)}async function y(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Ir(t);return await new Promise(((t,o)=>{const s=e=>{e&&n.getBufferedLength()<=Ar.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Lr(e,n),t()}catch(e){s(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&s(new Dr)}))})),n.getBufferedValue()}function x(){var t;return void 0!==on||(on=(!!process.env.CI||0===(null===(t=process.getuid)||void 0===t?void 0:t.call(process)))&&null!==e(gt).sync("sudo",{nothrow:!0})),on}function w(t,r,n){return x()?e(Ct).command("sudo "+[t,...r].map((e=>`'${e}'`)).join(" "),{shell:!0,cwd:n}):e(Ct)(t,r)}async function b(e,t,r=!0){const n="apt-get";if(process.env.DEBIAN_FRONTEND="noninteractive",sn||(await w(n,["update","-y"]),sn=!0),an||(await w(n,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]),an=!0),Array.isArray(r)){for(const e of r)await w("add-apt-repository",["--update","-y",e]);await w(n,["update","-y"])}if(void 0!==t&&""!==t)try{await w(n,["install","--fix-broken","-y",`${e}=${t}`])}catch{await w(n,["install","--fix-broken","-y",`${e}-${t}`])}else await w(n,["install","--fix-broken","-y",e]);return{binDir:"/usr/bin/"}}function E(t,r){return cn&&null!==e(gt).sync("brew",{nothrow:!0})||(c(0,0,process),cn=!0),e(Ct).sync("brew",["install",void 0!==r&&""!==r?`${t}@${r}`:t]),{binDir:"/usr/local/bin/"}}function S(){return"true"===
2021-09-18 04:00:26 +08:00
//# sourceMappingURL=setup_cpp.js.map