setup-cpp/dist/node16/setup-cpp.js

4 lines
236 KiB
JavaScript
Raw Normal View History

#!/usr/bin/env node
2023-03-10 05:31:36 +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){return null==e?[]:Array.isArray(e)?e:[e]}function n(e,t,r,n){var o,s=e[t],i=~n.string.indexOf(t)?null==r||!0===r?"":r+"":"boolean"==typeof r?r:~n.boolean.indexOf(t)?"false"!==r&&("true"===r||(e._.push(0*(o=+r)==0?o:r),!!r)):0*(o=+r)==0?o:r;e[t]=null==s?i:Array.isArray(s)?s.concat(i):[s,i]}function o(e){return e&&e.__esModule?e.default:e}function s(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function i(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)=>{i(e,t||{},((e,t)=>{e?n(e):r(t)}))}))}Wt(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,s=o&&void 0!==process.chdir&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch(e){}let i;try{i=qt.sync(e.command,{path:r[nr({env:r})],pathExt:t?lt.delimiter:void 0})}catch(e){}finally{s&&process.chdir(n)}return i&&(i=(0,lt.resolve)(o?e.options.cwd:"",i)),i}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 mr&&1===e&&!t.file?c(t.original,"spawn"):null}function u(e,t,r){const n=rr(e,t,r),o=(0,yt.spawn)(n.command,n.args,n.options);return fr.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=pn(t);return await new Promise(((t,o)=>{const s=e=>{e&&n.getBufferedLength()<=fn.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await gn(e,n),t()}catch(e){s(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&s(new vn)}))})),n.getBufferedValue()}function p(){return null!==o(qt).sync("sudo",{nothrow:!0})}function h(){return 0===process.getuid?.()||!!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(er).commandSync("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):o(er).sync(e,t,r)}function v(e,t=[],r={stdio:"inherit",shell:!0}){return f()?o(er).command("sudo "+[e,...t].map((e=>`'${e}'`)).join(" "),r):o(er)(e,t,r)}function y(){return"win32"===process.platform?Hn():h()}function w(e){return f()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,lt.join)("/Users/",process.env.SUDO_USER,e):(0,lt.join)("/home/",process.env.SUDO_USER,e):t(Ut)("~/"+e)}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)}))}))}Wn(e,t||{},((e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function b(e,t){const r=e.options.env||process.env,n=process.cwd(),o=null!=e.options.cwd,s=o&&void 0!==process.chdir&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch(e){}let i;try{i=qn.sync(e.command,{path:r[no({env:r})],pathExt:t?lt.delimiter:void 0})}catch(e){}finally{s&&process.chdir(n)}return i&&(i=lt.resolve(o?e.options.cwd:"",i)),i}function E(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 go&&1===e&&!t.file?E(t.original,"spawn"):null}function _(e,t,r){const n=ro(e,t,r),o=yt.spawn(n.command,n.args,n.options);return mo.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=ms(t);return await new Promise(((t,o)=>{const s=e=>{e&&n.getBufferedLength()<=fs.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await vs(e,n),t()}catch(e){s(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&s(new ys)}))})),n.getBufferedValue()}function T(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,
//# sourceMappingURL=setup-cpp.js.map