setup-cpp/dist/setup_cpp.js

3 lines
149 KiB
JavaScript
Raw Normal View History

2021-12-01 18:21:51 +08:00
function e(e){return e&&e.__esModule?e.default:e}function t(e,t,r,o){Object.defineProperty(e,t,{get:r,set:o,enumerable:!0,configurable:!0})}function r(e,t,r){const o=new qe(e,t,r);process.stdout.write(""+o+He.EOL)}function o(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 n(e,t={}){Me.issueCommand("error",Be.toCommandProperties(t),e instanceof Error?""+e:e)}function s(e){Me.issue("group",e)}function i(){Me.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,o)=>{a(e,t||{},((e,t)=>{e?o(e):r(t)}))}))}ut(e,t||{},((e,o)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,o=!1),r(e,o)}))}function c(t,r,o){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof mt)return{binDir:mt};const n=e(at).sync("brew",{nothrow:!0});return null!==n?(mt=le.dirname(n),{binDir:mt}):(ye.execFileSync('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),mt="/usr/local/bin/",{binDir:mt})}function l(e,t){const r=e.options.env||process.env,o=process.cwd(),n=null!=e.options.cwd,s=n&&void 0!==process.chdir&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch(e){}let i;try{i=at.sync(e.command,{path:r[xt({env:r})],pathExt:t?le.delimiter:void 0})}catch(e){}finally{s&&process.chdir(o)}return i&&(i=le.resolve(n?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 It&&1===e&&!t.file?u(t.original,"spawn"):null}function d(e,t,r){const o=yt(e,t,r),n=ye.spawn(o.command,o.args,o.options);return Tt.hookChildProcess(n,o),n}function h(e={}){const{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}function f(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe}async function m(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,o=mr(t);return await new Promise(((t,n)=>{const s=e=>{e&&o.getBufferedLength()<=gr.MAX_LENGTH&&(e.bufferedData=o.getBufferedValue()),n(e)};(async()=>{try{await xr(e,o),t()}catch(e){s(e)}})(),o.on("data",(()=>{o.getBufferedLength()>r&&s(new wr)}))})),o.getBufferedValue()}function v(t,r,o){const n=Nr(t,r,o),s=$r(t,r),i=Rr(t,r);let a;(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||0>e))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(n.options);try{a=e(Ee).spawn(n.file,n.args,n.options)}catch(t){const r=new(e(Ee).ChildProcess),o=Promise.reject(Bt({error:t,stdout:"",stderr:"",all:"",command:s,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return Cr(r,o)}const c=(e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})})),e.on("error",(e=>{r(e)})),e.stdin&&e.stdin.on("error",(e=>{r(e)}))})))(a),l=((e,{timeout:t,killSignal:r="SIGTERM"},o)=>{if(0===t||void 0===t)return o;let n;const s=new Promise(((o,s)=>{n=setTimeout((()=>{((e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}))})(e,r,s)}),t)})),i=o.finally((()=>{clearTimeout(n)}));return Promise.race([s,i])})(a,n.options,c),u=(async(t,{cleanup:r,detached:o},n)=>{if(!r||o)return n;const s=e(Wt)((()=>{t.kill()}));return n.finally((()=>{s()}))})(a,n.options,l),p={isCanceled:!1};a.kill=lr.bind(null,a.kill.bind(a)),a.cancel=fr.bind(null,a,p);const d=kt((async()=>{const[{error:e,exitCode:t,signal:r,timedOut:o},c,l,d]=await(async({stdout:e,stderr:t,all:r},{encoding:o,buffer:n,maxBuffer:s},i)=>{const a=Or(e,{encoding:o,buffer:n,maxBuffer:s}),c=Or(t,{encoding:o,buffer:n,maxBuffer:s}),l=Or(r,{encoding:o,buffer:n,maxBuffer:2*s});try{return await Promise.all([i,a,c,l])}catch(o){return Promise.all([{error:o,signal:o.signal,tim
2021-09-18 04:00:26 +08:00
//# sourceMappingURL=setup_cpp.js.map