setup-cpp/dist/node16/setup_cpp.js

3 lines
218 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)}))}))}Nt(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=Rt.sync(e.command,{path:r[Ut({env:r})],pathExt:t?it.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=it.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 Kt&&1===e&&!t.file?o(t.original,"spawn"):null}function s(e,t,r){const n=Pt(e,t,r),o=ft.spawn(n.command,n.args,n.options);return Yt.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=Xr(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Yr.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Zr(e,n),t()}catch(e){i(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Jr)}))})),n.getBufferedValue()}async function c(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof Un)return{binDir:Un};const o=t(On).sync("brew",{nothrow:!0});if(null!==o)return Un=(0,_n.dirname)(o),{binDir:Un};const i=t(it).join((0,ot.tmpdir)(),"setup_cpp","brew");await(0,Dn.mkdirP)(i),t(Ct).sync("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:i});const s=(0,it.join)(i,"install.sh");return"linux"===process.platform&&(0,st.readFileSync)(s,"utf-8").replace("#!/bin/bash",""),t(Ct).sync("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),Un="/usr/local/bin/",{binDir:Un}}function l(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function u(){return null!==t(Rt).sync("sudo",{nothrow:!0})}function d(){return 0===process.getuid?.()||!!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(Ct).commandSync("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),n):t(Ct).sync(e,r,n)}function m(e,r=[],n={stdio:"inherit",shell:!0}){return p()?t(Ct).command("sudo "+[e,...r].map((e=>`'${e}'`)).join(" "),n):t(Ct)(e,r,n)}function g(){return"win32"===process.platform?Gn():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)}))}))}eo(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=Zn.sync(e.command,{path:r[lo({env:r})],pathExt:t?it.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=(0,it.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 Eo&&1===e&&!t.file?b(t.original,"spawn"):null}function S(e,t,r){const n=co(e,t,r),o=(0,ft.spawn)(n.command,n.args,n.options);return bo.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=yi(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=wi.MAX_LENGTH&&(e.bufferedData=n.get
//# sourceMappingURL=setup_cpp.js.map