setup-cpp/dist/node16/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=Lt.sync(e.command,{path:r[zt({env:r})],pathExt:t?ut.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=ut.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 tr&&1===e&&!t.file?o(t.original,"spawn"):null}function s(e,t,r){const n=kt(e,t,r),o=wt.spawn(n.command,n.args,n.options);return er.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()<=en.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await rn(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new nn)}))})),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)}))}))}eo(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=Zn.sync(e.command,{path:r[lo({env:r})],pathExt:t?ut.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,ut.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 Eo&&1===e&&!t.file?p(t.original,"spawn"):null}function f(e,t,r){const n=co(e,t,r),o=(0,wt.spawn)(n.command,n.args,n.options);return bo.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=yi(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 Ei(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Si)}))})),n.getBufferedValue()}function g(){return null!==c(Zn).sync("sudo",{nothrow:!0})}function v(){return 0===process.getuid?.()||!!process.env.CI}function y(){return v()&&g()}function w(e){return y()?"sudo "+e:e}function x(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(so).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(so).sync(e,t,r)}function b(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(so).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(so)(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,ut.join)("/Users/",process.env.SUDO_USER,e):(0,ut.join)("/home/",process.env.SUDO_USER,e):t(Bn)("~/"+e)}function O(e,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){return t(At)((()=>{if(void 0===Ji){const e=t(Lt).sync("pwsh",{nothrow:!0});null!==e&&(Ji=e);const r=t(Lt).sync("powershell",{nothrow:!0});null!==r&&(Ji=r)}if(void 0===Ji)throw Error("Could not find powershell");return Ji})(),[...r,"-c",e],n)}function _(e){"linux"!==process.platform&&
//# sourceMappingURL=setup_cpp.js.map