setup-cpp/dist/setup_cpp.js

3 lines
202 KiB
JavaScript
Raw Normal View History

2022-08-26 18:34:54 +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)}))}))}Ot(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 It)return{binDir:It};const o=t(bt).sync("brew",{nothrow:!0});return null!==o?(It=(0,xt.dirname)(o),{binDir:It}):((0,ct.execFileSync)('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',{stdio:"inherit"}),It="/usr/local/bin/",{binDir:It})}function o(e){return e&&e.__esModule?e.default:e}function i(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function s(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)=>{s(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}Ut(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function a(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[Xt({env:r})],pathExt:t?Qe.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,Qe.resolve)(o?e.options.cwd:"",s)),s}function c(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 l(e,t){return ir&&1===e&&!t.file?c(t.original,"spawn"):null}function u(e,t,r){const n=Vt(e,t,r),o=(0,ct.spawn)(n.command,n.args,n.options);return or.hookChildProcess(o,n),o}async function d(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 p(){return null!==o(Lt).sync("sudo",{nothrow:!0})}function h(){var e;return 0===(null===(e=process.getuid)||void 0===e?void 0:e.call(process))||!!process.env.CI}function f(){return h()&&p()}function m(e){return f()?"sudo "+e:e}function g(e,t=[],r={stdio:"inherit",shell:!0}){return f()?o(Ht).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):o(Ht).sync(e,t,r)}function v(e,t=[],r={stdio:"inherit",shell:!0}){return f()?o(Ht).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):o(Ht)(e,t,r)}function y(){return"win32"===process.platform?Nn():h()}function w(e){return f()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,Qe.join)("/Users/",process.env.SUDO_USER,e):(0,Qe.join)("/home/",process.env.SUDO_USER,e):t(Ln)("~/"+e)}function x(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=bt.sync(e.command,{path:r[zn({env:r})],pathExt:t?Qe.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=Qe.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 to&&1===e&&!t.file?b(t.original,"spawn"):null}function S(e,t,r){const n=Bn(e,t,r),o=ct.spawn(n.command,n.args,n.options);return eo.hookChildProcess(o,n),o}async function O(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Qo(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=ti.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await ni(e,n),t()}catch(e){i(e)}})(),n.on("data",((
2022-08-08 09:30:29 +08:00
//# sourceMappingURL=setup_cpp.js.map