setup-cpp/dist/node12/setup-cpp.js

3 lines
242 KiB
JavaScript
Raw Normal View History

#!/usr/bin/env node
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 e&&e.__esModule?e.default:e;}function n(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}function o(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)=>{o(e,t||{},(e,t)=>{e?n(e):r(t);});});}cr(e,t||{},(e,n)=>{e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n);});}function i(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=ir.sync(e.command,{path:r[vr({env:r})],pathExt:t?Et.delimiter:void 0});}catch(e){}finally{i&&process.chdir(n);}return s&&(s=(0,Et.resolve)(o?e.options.cwd:"",s)),s;}function s(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 a(e,t){return _r&&1===e&&!t.file?s(t.original,"spawn"):null;}function c(e,t,r){const n=gr(e,t,r),o=(0,Ct.spawn)(n.command,n.args,n.options);return Cr.hookChildProcess(o,n),o;}async function l(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Rn(t);return await new Promise((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=Cn.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e);};(async()=>{try{await Pn(e,n),t();}catch(e){i(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&i(new An());});}),n.getBufferedValue();}function u(){return null!==r(ir).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 f(e){return p()?"sudo "+e:e;}function m(e,t=[],n={stdio:"inherit",shell:!0}){return p()?r(mr).commandSync("sudo "+[e,...t].map(e=>`'${e}'`).join(" "),n):r(mr).sync(e,t,n);}function h(e,t=[],n={stdio:"inherit",shell:!0}){return p()?r(mr).command("sudo "+[e,...t].map(e=>`'${e}'`).join(" "),n):r(mr)(e,t,n);}function g(){return"win32"===process.platform?no():d();}function v(e){return p()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,Et.join)("/Users/",process.env.SUDO_USER,e):(0,Et.join)("/home/",process.env.SUDO_USER,e):t(Jt)("~/"+e);}function E(e){return e&&"object"==typeof e&&"default"in e?e:{default:e};}function y(e,t,r,n){return new(r||(r=Promise))((o,i)=>{function s(e){try{c(n.next(e));}catch(e){i(e);}}function a(e){try{c(n.throw(e));}catch(e){i(e);}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(e=>{e(t);})).then(s,a);}c((n=n.apply(e,t||[])).next());});}function w(e,t){function r(r){return s=>(r=>{if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue;}if(3===r[0]&&(!i||r[1]>i[0]&&i[3]>r[1])){a.label=r[1];break;}if(6===r[0]&&i[1]>a.label){a.label=i[1],i=r;break;}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(r);break;}i[2]&&a.ops.pop(),a.trys.pop();continue;}r=t.call(e,a);}catch(e){r=[6,e],o=0;}finally{n=i=0;}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0};})([r,s]);}var n,o,i,s,a={label:0,sent(){if(1&i[0])throw i[1];return i[1];},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this;}),s;}function x(e){return null==e?[]:Array.isArray(e)?e:[e];}function b(e,t,r,n){var o,i=e[t],s=~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]
2023-04-23 16:06:16 +08:00
//# sourceMappingURL=setup-cpp.js.map