setup-cpp/dist/node12/setup_cpp.js

3 lines
224 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)}))}))}Gt(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=Dt.sync(e.command,{path:r[Vt({env:r})],pathExt:t?ht.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=ht.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 or&&1===e&&!t.file?o(t.original,"spawn"):null}function s(e,t,r){const n=Mt(e,t,r),o=Et.spawn(n.command,n.args,n.options);return nr.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=tn(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=nn.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await sn(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new an)}))})),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)}))}))}no(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=eo.sync(e.command,{path:r[ho({env:r})],pathExt:t?ht.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,ht.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 Oo&&1===e&&!t.file?p(t.original,"spawn"):null}function f(e,t,r){const n=po(e,t,r),o=(0,Et.spawn)(n.command,n.args,n.options);return _o.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=bi(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Si.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Oi(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Ti)}))})),n.getBufferedValue()}function g(){return null!==c(eo).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 w(e){return y()?"sudo "+e:e}function x(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(lo).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(lo).sync(e,t,r)}function b(e,t=[],r={stdio:"inherit",shell:!0}){return y()?c(lo).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):c(lo)(e,t,r)}function E(){return"win32"===process.platform?Qi():v()}function S(e){return y()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,ht.join)("/Users/",process.env.SUDO_USER,e):(0,ht.join)("/home/",process.env.SUDO_USER,e):t(qn)("~/"+e)}function _(e,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){return t(Lt)((()=>{if(void 0===ts){const e=t(Dt).sync("pwsh",{nothrow:!0});null!==e&&(ts=e);const r=t(Dt).sync("powershell",{nothrow:!0});null!==r&&(ts=r)}if(void 0===ts)throw Error("Could not find powershell");return ts})(),[...r,"-c
//# sourceMappingURL=setup_cpp.js.map