setup-cpp/dist/node12/setup-cpp.js

4 lines
225 KiB
JavaScript
Raw Normal View History

#!/usr/bin/env node
2023-04-22 17:23:32 +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){return null==e?[]:Array.isArray(e)?e:[e]}function n(e,t,r,n){var o,i=e[t],s=~n.string.indexOf(t)?null==r||!0===r?"":r+"":"boolean"==typeof r?r:~n.boolean.indexOf(t)?"false"!==r&&("true"===r||(e._.push(0*(o=+r)==0?o:r),!!r)):0*(o=+r)==0?o:r;e[t]=null==i?s:Array.isArray(i)?i.concat(s):[i,s]}function o(e){return e&&e.__esModule?e.default:e}function i(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function s(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)=>{s(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}ur(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function a(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=ar.sync(e.command,{path:r[wr({env:r})],pathExt:t?gt.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,gt.resolve)(o?e.options.cwd:"",s)),s}function c(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 l(e,t){return Rr&&1===e&&!t.file?c(t.original,"spawn"):null}function u(e,t,r){const n=yr(e,t,r),o=(0,It.spawn)(n.command,n.args,n.options);return Pr.hookChildProcess(o,n),o}async function d(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=$n(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Pn.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await An(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Nn)}))})),n.getBufferedValue()}function p(){return null!==o(ar).sync("sudo",{nothrow:!0})}function f(){var e;return 0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process))||!!process.env.CI}function h(){return f()&&p()}function m(e){return h()?"sudo "+e:e}function v(e,t=[],r={stdio:"inherit",shell:!0}){return h()?o(vr).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):o(vr).sync(e,t,r)}function g(e,t=[],r={stdio:"inherit",shell:!0}){return h()?o(vr).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):o(vr)(e,t,r)}function y(){return"win32"===process.platform?io():f()}function w(e){return h()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,gt.join)("/Users/",process.env.SUDO_USER,e):(0,gt.join)("/home/",process.env.SUDO_USER,e):t(er)("~/"+e)}function x(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)=>{x(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}uo(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function b(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=ao.sync(e.command,{path:r[xo({env:r})],pathExt:t?gt.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=gt.resolve(o?e.options.cwd:"",s)),s}function E(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 S(e,t){return Ao&&1===e&&!t.file?E(t.original,"spawn"):null}function T(e,t,r){const n=wo(e,t,r),o=It.spawn(n.command,n.args,n.options);return Ro.hookChildProcess(o,n),o}async function O(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=_i(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Ri.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Ni(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new ki)}))})),n.getBufferedValue()}function
//# sourceMappingURL=setup-cpp.js.map