setup-cpp/dist/node16/setup_cpp.js

3 lines
220 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)}))}))}kt(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=It.sync(e.command,{path:r[Mt({env:r})],pathExt:t?st.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=st.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 Zt&&1===e&&!t.file?o(t.original,"spawn"):null}function s(e,t,r){const n=Rt(e,t,r),o=mt.spawn(n.command,n.args,n.options);return Kt.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=Wr(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Kr.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Jr(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Qr)}))})),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)}))}))}Kn(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=Xn.sync(e.command,{path:r[io({env:r})],pathExt:t?st.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,st.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 yo&&1===e&&!t.file?p(t.original,"spawn"):null}function f(e,t,r){const n=oo(e,t,r),o=(0,mt.spawn)(n.command,n.args,n.options);return vo.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=fi(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=gi.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await yi(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new wi)}))})),n.getBufferedValue()}function g(){return null!==c(Xn).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(ro).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(ro).sync(e,t,r)}function b(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(ro).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(ro)(e,t,r)}function E(){return"win32"===process.platform?Vi():v()}function S(e){return y()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,st.join)("/Users/",process.env.SUDO_USER,e):(0,st.join)("/home/",process.env.SUDO_USER,e):t(Un)("~/"+e)}function O(e,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){return t($t)((()=>{if(void 0===Wi){const e=t(It).sync("pwsh",{nothrow:!0});null!==e&&(Wi=e);const r=t(It).sync("powershell",{nothrow:!0});null!==r&&(Wi=r)}if(void 0===Wi)throw Error("Could not find powershell");return Wi})(),[...r,"-c",e],n)}function _(e){"linux"!==process.platform&&
//# sourceMappingURL=setup_cpp.js.map