setup-cpp/dist/legacy/setup-cpp.js

4 lines
373 KiB
JavaScript
Raw Normal View History

2023-07-16 06:41:58 +08:00
#!/usr/bin/env node
2024-10-26 08:28:42 +08:00
"use strict";function e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}function t(e){return e&&e.__esModule&&{}.hasOwnProperty.call(e,"default")?e.default:e}function n(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}function r(e,t,n){const r=new ro(e,t,n);process.stdout.write(""+r+to.EOL)}function o(e){const t="https:"===e.protocol;if(function(e){if(!e.hostname)return!1;if(function(e){const t=e.toLowerCase();return"localhost"===t||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}(e.hostname))return!0;const t=process.env.no_proxy||process.env.NO_PROXY||"";if(!t)return!1;let n;e.port?n=Number(e.port):"http:"===e.protocol?n=80:"https:"===e.protocol&&(n=443);const r=[e.hostname.toUpperCase()];"number"==typeof n&&r.push(`${r[0]}:${n}`);for(const o of t.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e)))if("*"===o||r.some((e=>e===o||e.endsWith("."+o)||o.startsWith(".")&&e.endsWith(""+o))))return!0;return!1}(e))return;const n=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(n)try{return new ho(n)}catch{if(!n.startsWith("http://")&&!n.startsWith("https://"))return new ho("http://"+n)}}function i(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||vo.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,n,r,o){for(var i=a(n,r,o),s=0,c=t.requests.length;c>s;++s){var l=t.requests[s];if(l.host===i.host&&l.port===i.port)return t.requests.splice(s,1),void l.request.onSocket(e)}e.destroy(),t.removeSocket(e)}))}function s(e,t){var n=this;i.prototype.createSocket.call(n,e,(function(r){var o=e.request.getHeader("host"),i=c({},n.options,{socket:r,servername:o?o.replace(/:.*$/,""):e.host}),s=go.connect(0,i);n.sockets[n.sockets.indexOf(r)]=s,t(s)}))}function a(e,t,n){return"string"==typeof e?{host:e,port:t,localAddress:n}:e}function c(e){for(var t=1,n=arguments.length;n>t;++t){var r=arguments[t];if("object"==typeof r)for(var o=Object.keys(r),i=0,s=o.length;s>i;++i){var a=o[i];void 0!==r[a]&&(e[a]=r[a])}}return e}function l(){return Uo||(Uo=1,function(e){var t=Vr&&Vr.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;const n=br,r=_r,{access:o,appendFile:i,writeFile:s}=r.promises;e.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY",e.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";const a=new class{constructor(){this._buffer=""}filePath(){return t(this,void 0,void 0,(function*(){if(this._filePath)return this._filePath;const t=process.env[e.SUMMARY_ENV_VAR];if(!t)throw Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield o(t,r.constants.R_OK|r.constants.W_OK)}catch(n){throw Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath}))}wrap(e,t,n={}){const r=Object.entries(n).map((([e,t])=>` ${e}="${t}"`)).join("");return t?`<${e}${r}>${t}</${e}>`:`<${e}${r}>`}write(e){return t(this,void 0,void 0,(function
//# sourceMappingURL=setup-cpp.js.map