setup-cpp/dist/node12/setup_cpp.js

3 lines
223 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,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)}))}))}Ut(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=jt.sync(e.command,{path:r[zt({env:r})],pathExt:t?dt.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=dt.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 rr&&1===e&&!t.file?o(t.original,"spawn"):null}function s(e,t,r){const n=Lt(e,t,r),o=wt.spawn(n.command,n.args,n.options);return tr.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=Zr(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=tn.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await nn(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new on)}))})),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)}))}))}to(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=Qn.sync(e.command,{path:r[uo({env:r})],pathExt:t?dt.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,dt.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 So&&1===e&&!t.file?p(t.original,"spawn"):null}function f(e,t,r){const n=lo(e,t,r),o=(0,wt.spawn)(n.command,n.args,n.options);return Eo.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=xi(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=bi.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Si(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new _i)}))})),n.getBufferedValue()}function g(){return null!==c(Qn).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(ao).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(ao).sync(e,t,r)}function b(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(ao).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(ao)(e,t,r)}function E(){return"win32"===process.platform?Yi():v()}function S(e){return y()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,dt.join)("/Users/",process.env.SUDO_USER,e):(0,dt.join)("/home/",process.env.SUDO_USER,e):t(Hn)("~/"+e)}function _(e,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){return t(kt)((()=>{if(void 0===Zi){const e=t(jt).sync("pwsh",{nothrow:!0});null!==e&&(Zi=e);const r=t(jt).sync("powershell",{nothrow:!0});null!==r&&(Zi=r)}if(void 0===Zi)throw Error("Could not find powershell");return Zi})(),[...r,"-c
//# sourceMappingURL=setup_cpp.js.map