setup-cpp/dist/node12/setup_cpp.js

3 lines
221 KiB
JavaScript
Raw Normal View History

2022-11-23 14:17:42 +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,n){if("function"==typeof t&&(n=t,t={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise(((n,o)=>{r(e,t||{},((e,t)=>{e?o(e):n(t)}))}))}Mt(e,t||{},((e,r)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)}))}function n(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=Nt.sync(e.command,{path:r[Bt({env:r})],pathExt:t?lt.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=lt.resolve(o?e.options.cwd:"",s)),s}function o(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 i(e,t){return er&&1===e&&!t.file?o(t.original,"spawn"):null}function s(e,t,r){const n=kt(e,t,r),o=yt.spawn(n.command,n.args,n.options);return Zt.hookChildProcess(o,n),o}async function a(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Jr(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 tn(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new rn)}))})),n.getBufferedValue()}function c(e){return e&&e.__esModule?e.default:e}function l(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function u(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)=>{u(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}Zn(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function d(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=Yn.sync(e.command,{path:r[co({env:r})],pathExt:t?lt.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,lt.resolve)(o?e.options.cwd:"",s)),s}function p(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 h(e,t){return bo&&1===e&&!t.file?p(t.original,"spawn"):null}function f(e,t,r){const n=ao(e,t,r),o=(0,yt.spawn)(n.command,n.args,n.options);return wo.hookChildProcess(o,n),o}async function m(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=vi(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=xi.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await bi(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Ei)}))})),n.getBufferedValue()}function g(){return null!==c(Yn).sync("sudo",{nothrow:!0})}function v(){var e;return 0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process))||!!process.env.CI}function y(){return v()&&g()}function x(e){return y()?"sudo "+e:e}function w(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(io).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(io).sync(e,t,r)}function b(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(io).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(io)(e,t,r)}function E(){return"win32"===process.platform?Wi():v()}function S(e){return y()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,lt.join)("/Users/",process.env.SUDO_USER,e):(0,lt.join)("/home/",process.env.SUDO_USER,e):t(Gn)("~/"+e)}function _(e,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){return t(Rt)((()=>{if(void 0===Ji){const e=t(Nt).sync("pwsh",{nothrow:!0});null!==e&&(Ji=e);const r=t(Nt).sync("powershell",{nothrow:!0});null!==r&&(Ji=r)}if(void 0===Ji)throw Error("Could not find powershell");return Ji})(),[...r,"-c
//# sourceMappingURL=setup_cpp.js.map