setup-cpp/dist/node12/setup_cpp.js

3 lines
217 KiB
JavaScript
Raw Normal View History

2022-11-05 06:02:51 +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)}))}))}kt(e,t||{},((e,r)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)}))}function n(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof Dt)return{binDir:Dt};const o=t(It).sync("brew",{nothrow:!0});return null!==o?(Dt=(0,Pt.dirname)(o),{binDir:Dt}):((0,vt.execFileSync)('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),Dt="/usr/local/bin/",{binDir:Dt})}function o(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[Ht({env:r})],pathExt:t?ct.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=ct.resolve(o?e.options.cwd:"",s)),s}function i(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 s(e,t){return tr&&1===e&&!t.file?i(t.original,"spawn"):null}function a(e,t,r){const n=Bt(e,t,r),o=vt.spawn(n.command,n.args,n.options);return er.hookChildProcess(o,n),o}async function c(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Qr(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 l(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function u(){return null!==t(It).sync("sudo",{nothrow:!0})}function d(){var e;return 0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process))||!!process.env.CI}function p(){return d()&&u()}function h(e){return p()?"sudo "+e:e}function f(e,r=[],n={stdio:"inherit",shell:!0}){return p()?t(Ft).commandSync("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),n):t(Ft).sync(e,r,n)}function m(e,r=[],n={stdio:"inherit",shell:!0}){return p()?t(Ft).command("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),n):t(Ft)(e,r,n)}function g(){return"win32"===process.platform?Rn():d()}function v(e){return e&&e.__esModule?e.default:e}function y(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function x(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)=>{x(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 w(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=Gn.sync(e.command,{path:r[Zn({env:r})],pathExt:t?ct.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,ct.resolve)(o?e.options.cwd:"",s)),s}function b(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 E(e,t){return po&&1===e&&!t.file?b(t.original,"spawn"):null}function S(e,t,r){const n=Qn(e,t,r),o=(0,vt.spawn)(n.command,n.args,n.options);return uo.hookChildProcess(o,n),o}async function _(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=ci(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=ui.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await pi(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new hi)}))})),n.getBufferedValue()}function O(){return null!==v(Gn).sync("sudo
//# sourceMappingURL=setup_cpp.js.map