Template
1
0
mirror of https://github.com/aminya/setup-cpp synced 2024-11-30 21:22:30 +08:00
setup-cpp/dist/node12/setup-cpp.js

45 lines
247 KiB
JavaScript
Raw Normal View History

#!/usr/bin/env node
let e,t,r,n,i,o,s,a,c,l;var u,d,p=require("os"),f=require("path"),m=require("fs"),h=require("crypto"),g=require("http"),v=require("https");require("net");var E=require("tls"),y=require("events"),w=require("assert"),x=require("util"),b=require("fs"),S=require("child_process"),I=require("string_decoder"),O=require("timers"),R=require("buffer"),T=require("stream"),C=require("process"),_=require("buffer"),P=require("path"),$=require("child_process"),A=require("process"),N=require("url"),L=require("os"),D=require("util"),U=require("url");function k(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}function j(e){return e&&e.__esModule?e.default:e;}var M="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},G={},F={},B=M.parcelRequire810d;null==B&&((B=function(e){if(e in G)return G[e].exports;if(e in F){var t=F[e];delete F[e];var r={id:e,exports:{}};return G[e]=r,t.call(r.exports,r,r.exports),r.exports;}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n;}).register=function(e,t){F[e]=t;},M.parcelRequire810d=B),B.register("cLprm",function(e,t){"use strict";var r=B("iQYeD");let n=process.env;function i(e){return"string"==typeof e?!!n[e]:"env"in e?n[e.env]&&n[e.env].includes(e.includes):"any"in e?e.any.some(function(e){return!!n[e];}):Object.keys(e).every(function(t){return n[t]===e[t];});}Object.defineProperty(e.exports,"_vendors",{value:r.map(function(e){return e.constant;})}),e.exports.name=null,e.exports.isPR=null,r.forEach(function(t){let r=Array.isArray(t.env)?t.env:[t.env],o=r.every(function(e){return i(e);});if(e.exports[t.constant]=o,o)switch(e.exports.name=t.name,typeof t.pr){case"string":e.exports.isPR=!!n[t.pr];break;case"object":"env"in t.pr?e.exports.isPR=t.pr.env in n&&n[t.pr.env]!==t.pr.ne:"any"in t.pr?e.exports.isPR=t.pr.any.some(function(e){return!!n[e];}):e.exports.isPR=i(t.pr);break;default:e.exports.isPR=null;}}),e.exports.isCI=!!("false"!==n.CI&&(n.BUILD_ID||n.BUILD_NUMBER||n.CI||n.CI_APP_ID||n.CI_BUILD_ID||n.CI_BUILD_NUMBER||n.CI_NAME||n.CONTINUOUS_INTEGRATION||n.RUN_ID||e.exports.name));}),B.register("iQYeD",function(e,t){e.exports=JSON.parse('[{"name":"Appcircle","constant":"APPCIRCLE","env":"AC_APPCIRCLE"},{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI","pr":"SYSTEM_PULLREQUEST_PULLREQUESTID"},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"Codefresh","constant":"CODEFRESH","env":"CF_BUILD_ID","pr":{"any":["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{"name":"Codemagic","constant":"CODEMAGIC","env":"CM_BUILD_ID","pr":"CM_PULL_REQUEST"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"Expo Application Services","constant":"EAS","env":"EAS_BUILD"},{"name":"Gerrit","constant":"GERRIT","env":"GERRIT_PROJECT"},{"name":"GitHub Actions","constant":"GITHUB_ACTIONS","env":"GITHUB_ACTIONS","pr":{"GITHUB_EVENT_NAME":"pull_request"}},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI","pr":"CI_MERGE_REQUEST_ID"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Google Cloud Build","co
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);},e.exports.setOutput=function(e,t){process.stdout.write(d.EOL),c.issueCommand("set-output",{name:e},t);},e.exports.setCommandEcho=function(e){c.issue("echo",e?"on":"off");},e.exports.setFailed=function(e){process.exitCode=n.Failure,E(e);},e.exports.isDebug=function(){return"1"===process.env.RUNNER_DEBUG;},e.exports.debug=function(e){c.issueCommand("debug",{},e);},e.exports.error=E,e.exports.warning=function(e,t={}){c.issueCommand("warning",u.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.notice=function(e,t={}){c.issueCommand("notice",u.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.info=function(e){process.stdout.write(e+d.EOL);},e.exports.startGroup=y,e.exports.endGroup=w,e.exports.group=function(e,t){return a(this,void 0,void 0,function*(){let r;y(e);try{r=yield t();}finally{w();}return r;});},e.exports.saveState=function(e,t){c.issueCommand("save-state",{name:e},t);},e.exports.getState=function(e){return process.env[`STATE_${e}`]||"";},e.exports.getIDToken=function(e){return a(this,void 0,void 0,function*(){return yield g.OidcClient.getIDToken(e);});};var x=B("1yBCw");Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return x.summary;}});var x=B("1yBCw");Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return x.markdownSummary;}});var b=B("1tHq1");Object.defineProperty(e.exports,"toPosixPath",{enumerable:!0,get:function(){return b.toPosixPath;}}),Object.defineProperty(e.exports,"toWin32Path",{enumerable:!0,get:function(){return b.toWin32Path;}}),Object.defineProperty(e.exports,"toPlatformPath",{enumerable:!0,get:function(){return b.toPlatformPath;}});}),B.register("6mTwv",function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.issue=e.exports.issueCommand=void 0;let o=i(p);var s=B("4BVCZ");function a(e,t,r){let n=new c(e,t,r);process.stdout.write(n.toString()+o.EOL);}e.exports.issueCommand=a,e.exports.issue=function(e,t=""){a(e,{},t);};class c{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r;}toString(){var e;let t="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let e=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let n=this.properties[r];n&&(e?e=!1:t+=",",t+=`${r}=${s.toCommandValue(n).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return t+`::${(e=this.message,s.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A"))}`;}}}),B.register("4BVCZ",function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.toCommandProperties=e.exports.toCommandValue=void 0,e.exports.toCommandValue=function(e){return null==e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e);},e.exports.toCommandProperties=function(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{};};}),B.register("bRVRZ",function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t
Error Code : ${e.statusCode}
Error Message: ${e.result.message}`);}),i=null===(t=n.result)||void 0===t?void 0:t.value;if(!i)throw Error("Response json body do not have ID Token field");return i;});}static getIDToken(e){return r(this,void 0,void 0,function*(){try{let t=s.getIDTokenUrl();if(e){let r=encodeURIComponent(e);t=`${t}&audience=${r}`;}o.debug(`ID token url is ${t}`);let r=yield s.getCall(t);return o.setSecret(r),r;}catch(e){throw Error(`Error message: ${e.message}`);}});}}e.exports.OidcClient=s;}),B.register("aPbbM",function(e,t){"use strict";var r,n,i,o,s,a=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),c=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),l=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&a(t,e,r);return c(t,e),t;},u=e.exports&&e.exports.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e));}catch(e){o(e);}}function a(e){try{c(n.throw(e));}catch(e){o(e);}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}c((n=n.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.HttpClient=e.exports.isHttps=e.exports.HttpClientResponse=e.exports.HttpClientError=e.exports.getProxyUrl=e.exports.MediaTypes=e.exports.Headers=e.exports.HttpCodes=void 0;let d=l(g),p=l(v),f=l(B("dG8Uc")),m=l(B("j6C2A"));(r=i=e.exports.HttpCodes||(e.exports.HttpCodes={}))[r.OK=200]="OK",r[r.MultipleChoices=300]="MultipleChoices",r[r.MovedPermanently=301]="MovedPermanently",r[r.ResourceMoved=302]="ResourceMoved",r[r.SeeOther=303]="SeeOther",r[r.NotModified=304]="NotModified",r[r.UseProxy=305]="UseProxy",r[r.SwitchProxy=306]="SwitchProxy",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",r[r.BadRequest=400]="BadRequest",r[r.Unauthorized=401]="Unauthorized",r[r.PaymentRequired=402]="PaymentRequired",r[r.Forbidden=403]="Forbidden",r[r.NotFound=404]="NotFound",r[r.MethodNotAllowed=405]="MethodNotAllowed",r[r.NotAcceptable=406]="NotAcceptable",r[r.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",r[r.RequestTimeout=408]="RequestTimeout",r[r.Conflict=409]="Conflict",r[r.Gone=410]="Gone",r[r.TooManyRequests=429]="TooManyRequests",r[r.InternalServerError=500]="InternalServerError",r[r.NotImplemented=501]="NotImplemented",r[r.BadGateway=502]="BadGateway",r[r.ServiceUnavailable=503]="ServiceUnavailable",r[r.GatewayTimeout=504]="GatewayTimeout",(n=o=e.exports.Headers||(e.exports.Headers={})).Accept="accept",n.ContentType="content-type",(s=e.exports.MediaTypes||(e.exports.MediaTypes={})).ApplicationJson="application/json",e.exports.getProxyUrl=function(e){let t=f.getProxyUrl(new URL(e));return t?t.href:"";};let h=[i.MovedPermanently,i.ResourceMoved,i.SeeOther,i.TemporaryRedirect,i.PermanentRedirect],E=[i.BadGateway,i.ServiceUnavailable,i.GatewayTimeout],y=["OPTIONS","GET","DELETE","HEAD"];class w extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,w.prototype);}}e.exports.HttpClientError=w;class x{constructor(e){this.message=e;}readBody(){return u(this,void 0,void 0,function*(){return new Promise(e=>u(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",e=>{t=Buffer.concat([t,e]);}),this.message.on("end",()=>{e(t.toString());});}));});}}e.exports.HttpClientResponse=x,e.exports.isHttps=function(e){let t=new URL(e);return"https:"===t.protocol;},e.exports.HttpClient=class{constructor(e,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=t||[],this.requestO
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);},e.exports.setOutput=function(e,t){let r=process.env.GITHUB_OUTPUT||"";if(r)return l.issueFileCommand("OUTPUT",l.prepareKeyValueMessage(e,t));process.stdout.write(d.EOL),c.issueCommand("set-output",{name:e},u.toCommandValue(t));},e.exports.setCommandEcho=function(e){c.issue("echo",e?"on":"off");},e.exports.setFailed=function(e){process.exitCode=n.Failure,v(e);},e.exports.isDebug=function(){return"1"===process.env.RUNNER_DEBUG;},e.exports.debug=function(e){c.issueCommand("debug",{},e);},e.exports.error=v,e.exports.warning=function(e,t={}){c.issueCommand("warning",u.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.notice=function(e,t={}){c.issueCommand("notice",u.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.info=function(e){process.stdout.write(e+d.EOL);},e.exports.startGroup=E,e.exports.endGroup=y,e.exports.group=function(e,t){return a(this,void 0,void 0,function*(){let r;E(e);try{r=yield t();}finally{y();}return r;});},e.exports.saveState=function(e,t){let r=process.env.GITHUB_STATE||"";if(r)return l.issueFileCommand("STATE",l.prepareKeyValueMessage(e,t));c.issueCommand("save-state",{name:e},u.toCommandValue(t));},e.exports.getState=function(e){return process.env[`STATE_${e}`]||"";},e.exports.getIDToken=function(e){return a(this,void 0,void 0,function*(){return yield h.OidcClient.getIDToken(e);});};var w=B("a9gnA");Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return w.summary;}});var w=B("a9gnA");Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return w.markdownSummary;}});var x=B("3zXsD");Object.defineProperty(e.exports,"toPosixPath",{enumerable:!0,get:function(){return x.toPosixPath;}}),Object.defineProperty(e.exports,"toWin32Path",{enumerable:!0,get:function(){return x.toWin32Path;}}),Object.defineProperty(e.exports,"toPlatformPath",{enumerable:!0,get:function(){return x.toPlatformPath;}});}),B.register("lxvYw",function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.issue=e.exports.issueCommand=void 0;let o=i(p);var s=B("3GPt4");function a(e,t,r){let n=new c(e,t,r);process.stdout.write(n.toString()+o.EOL);}e.exports.issueCommand=a,e.exports.issue=function(e,t=""){a(e,{},t);};class c{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r;}toString(){var e;let t="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let e=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let n=this.properties[r];n&&(e?e=!1:t+=",",t+=`${r}=${s.toCommandValue(n).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return t+`::${(e=this.message,s.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A"))}`;}}}),B.register("3GPt4",function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.toCommandProperties=e.exports.toCommandValue=void 0,e.exports.toCommandValue=function(e){return null==e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e);},e.exports.toCommandProperties=function(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{};};}),B.register("izMKk",function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Obj
Error Code : ${e.statusCode}
Error Message: ${e.result.message}`);}),i=null===(t=n.result)||void 0===t?void 0:t.value;if(!i)throw Error("Response json body do not have ID Token field");return i;});}static getIDToken(e){return r(this,void 0,void 0,function*(){try{let t=s.getIDTokenUrl();if(e){let r=encodeURIComponent(e);t=`${t}&audience=${r}`;}o.debug(`ID token url is ${t}`);let r=yield s.getCall(t);return o.setSecret(r),r;}catch(e){throw Error(`Error message: ${e.message}`);}});}}e.exports.OidcClient=s;}),B.register("a9gnA",function(e,t){"use strict";var r=e.exports&&e.exports.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e));}catch(e){o(e);}}function a(e){try{c(n.throw(e));}catch(e){o(e);}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}c((n=n.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.summary=e.exports.markdownSummary=e.exports.SUMMARY_DOCS_URL=e.exports.SUMMARY_ENV_VAR=void 0;let{access:n,appendFile:i,writeFile:o}=m.promises;e.exports.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY",e.exports.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";let s=new class{constructor(){this._buffer="";}filePath(){return r(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[e.exports.SUMMARY_ENV_VAR];if(!t)throw Error(`Unable to find environment variable for $${e.exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield n(t,m.constants.R_OK|m.constants.W_OK);}catch(e){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,r={}){let n=Object.entries(r).map(([e,t])=>` ${e}="${t}"`).join("");return t?`<${e}${n}>${t}</${e}>`:`<${e}${n}>`;}write(e){return r(this,void 0,void 0,function*(){let t=!!(null==e?void 0:e.overwrite),r=yield this.filePath();return yield(t?o:i)(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer();});}clear(){return r(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0});});}stringify(){return this._buffer;}isEmptyBuffer(){return 0===this._buffer.length;}emptyBuffer(){return this._buffer="",this;}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this;}addEOL(){return this.addRaw(p.EOL);}addCodeBlock(e,t){let r=Object.assign({},t&&{lang:t}),n=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(n).addEOL();}addList(e,t=!1){let r=e.map(e=>this.wrap("li",e)).join(""),n=this.wrap(t?"ol":"ul",r);return this.addRaw(n).addEOL();}addTable(e){let t=e.map(e=>{let t=e.map(e=>{if("string"==typeof e)return this.wrap("td",e);let{header:t,data:r,colspan:n,rowspan:i}=e,o=Object.assign(Object.assign({},n&&{colspan:n}),i&&{rowspan:i});return this.wrap(t?"th":"td",r,o);}).join("");return this.wrap("tr",t);}).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL();}addDetails(e,t){let r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL();}addImage(e,t,r){let{width:n,height:i}=r||{},o=Object.assign(Object.assign({},n&&{width:n}),i&&{height:i}),s=this.wrap("img",null,Object.assign({src:e,alt:t},o));return this.addRaw(s).addEOL();}addHeading(e,t){let r=`h${t}`,n=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",i=this.wrap(n,e);return this.addRaw(i).addEOL();}addSeparator(){let e=this.wrap("hr",null);return this.addRaw(e).addEOL();}addBreak(){let e=this.wrap("br",null);return this.addRaw(e).addEOL();}addQuote(e,t){let r=Object.assign({},t&&{cite:t}),n=this.wrap("blockquote",e,r);return this.addRaw(n).addEOL();}addLink(e,t){let r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL();}}();e.exports.markdownSummary=s,e.exports.summary=s;}),B.register("3zXsD",function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}
2023-05-27 04:08:18 +08:00
${n.message}`:m,v=[g,t,e].filter(Boolean).join("\n");return h?(n.originalMessage=n.message,n.message=v):n=Error(v),n.shortMessage=g,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=u&&!c,n;};var e9={};const e7=["stdin","stdout","stderr"],te=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return e7.map(t=>e[t]);if(e7.some(t=>void 0!==e[t]))throw Error("It's not possible to provide `stdio` in combination with one of "+e7.map(e=>`\`${e}\``).join(", "));if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);return Array.from({length:Math.max(t.length,e7.length)},(e,r)=>t[r]);};(e9=te).node=e=>{let t=te(e);return"ipc"===t?"ipc":void 0===t||"string"==typeof t?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];};var tt,tr={},tn=ep.process;const ti=e=>e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on;if(ti(tn)){var to,ts=eh("4c98W"),ta=/^win/i.test(tn.platform),tc=y;"function"!=typeof tc&&(tc=tc.EventEmitter),tn.__signal_exit_emitter__?to=tn.__signal_exit_emitter__:((to=tn.__signal_exit_emitter__=new tc()).count=0,to.emitted={}),to.infinite||(to.setMaxListeners(1/0),to.infinite=!0);var tl=()=>{tp&&ti(ep.process)&&(tp=!1,ts.forEach(e=>{try{tn.removeListener(e,td[e]);}catch(e){}}),tn.emit=tg,tn.reallyExit=tm,to.count-=1);};(tr=(e,t)=>{if(!ti(ep.process))return()=>{};w.equal(typeof e,"function","a callback must be provided for exit handler"),!1===tp&&tf();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),to.on(r,e),()=>{to.removeListener(r,e),0===to.listeners("exit").length&&0===to.listeners("afterexit").length&&tl();};}).unload=tl;var tu=(e,t,r)=>{to.emitted[e]||(to.emitted[e]=!0,to.emit(e,t,r));},td={};ts.forEach(e=>{td[e]=()=>{ti(ep.process)&&tn.listeners(e).length===to.count&&(tl(),tu("exit",null,e),tu("afterexit",null,e),ta&&"SIGHUP"===e&&(e="SIGINT"),tn.kill(tn.pid,e));};}),tr.signals=()=>ts;var tp=!1,tf=()=>{!tp&&ti(ep.process)&&(tp=!0,to.count+=1,ts=ts.filter(e=>{try{return tn.on(e,td[e]),!0;}catch(e){return!1;}}),tn.emit=tv,tn.reallyExit=th);};tr.load=tf;var tm=tn.reallyExit,th=e=>{ti(ep.process)&&(tn.exitCode=e||0,tu("exit",tn.exitCode,null),tu("afterexit",tn.exitCode,null),tm.call(tn,tn.exitCode));},tg=tn.emit,tv=function(e,t){if("exit"===e&&ti(ep.process)){void 0!==t&&(tn.exitCode=t);var r=tg.apply(this,arguments);return tu("exit",tn.exitCode,null),tu("afterexit",tn.exitCode,null),r;}return tg.apply(this,arguments);};}else tr=()=>()=>{};const tE=e=>e===p.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase();var ty,tw=(tt={spawnedKill(e,t="SIGTERM",r={}){let n=e(t);return((e,t,r,n)=>{if(!((e,{forceKillAfterTimeout:t},r)=>tE(e)&&!1!==t&&r)(t,r,n))return;let i=(({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||0>e)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;})(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();})(e,t,r,n),n;},spawnedCancel(e,t){e.kill()&&(t.isCanceled=!0);},setupTimeout(e,{timeout:t,killSignal:r="SIGTERM"},n){let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{e.kill(r),o(Object.assign(Error("Timed out"),{timedOut:!0,signal:r}));},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},validateTimeout({timeout:e}){if(void 0!==e&&(!Number.isFinite(e)||0>e))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);},async setExitHandler(e,{cleanup:t,detached:r},n){if(!t||r)return n;let i=tr(()=>{e.kill();});return n.finally(()=>{i();});}}).spawnedKill,tx=tt.spawnedCancel,tb=tt.setupTimeout,tS=tt.validateTimeout,tI=tt.setExitHandler,tO={};const tR=e=>n
${n.message}`:h,E=[v,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=u&&!c,n;};var nv={};"use strict";const nE=["stdin","stdout","stderr"],ny=e=>nE.some(t=>void 0!==e[t]),nw=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return nE.map(t=>e[t]);if(ny(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${nE.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,nE.length);return Array.from({length:r},(e,r)=>t[r]);};(nv=nw).node=e=>{let t=nw(e);return"ipc"===t?"ipc":void 0===t||"string"==typeof t?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];};var nx={},nb={},nS=M.process;const nI=function(e){return e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on;};if(nI(nS)){var nO,nR,nT=B("2dWxz"),nC=/^win/i.test(nS.platform),n_=y;"function"!=typeof n_&&(n_=n_.EventEmitter),nS.__signal_exit_emitter__?nR=nS.__signal_exit_emitter__:((nR=nS.__signal_exit_emitter__=new n_()).count=0,nR.emitted={}),nR.infinite||(nR.setMaxListeners(1/0),nR.infinite=!0);var nP=function(){nN&&nI(M.process)&&(nN=!1,nT.forEach(function(e){try{nS.removeListener(e,nA[e]);}catch(e){}}),nS.emit=nk,nS.reallyExit=nD,nR.count-=1);};(nb=function(e,t){if(!nI(M.process))return function(){};w.equal(typeof e,"function","a callback must be provided for exit handler"),!1===nN&&nL();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),nR.on(r,e),function(){nR.removeListener(r,e),0===nR.listeners("exit").length&&0===nR.listeners("afterexit").length&&nP();};}).unload=nP;var n$=function(e,t,r){nR.emitted[e]||(nR.emitted[e]=!0,nR.emit(e,t,r));},nA={};nT.forEach(function(e){nA[e]=function(){nI(M.process)&&nS.listeners(e).length===nR.count&&(nP(),n$("exit",null,e),n$("afterexit",null,e),nC&&"SIGHUP"===e&&(e="SIGINT"),nS.kill(nS.pid,e));};}),nb.signals=function(){return nT;};var nN=!1,nL=function(){!nN&&nI(M.process)&&(nN=!0,nR.count+=1,nT=nT.filter(function(e){try{return nS.on(e,nA[e]),!0;}catch(e){return!1;}}),nS.emit=nj,nS.reallyExit=nU);};nb.load=nL;var nD=nS.reallyExit,nU=function(e){nI(M.process)&&(nS.exitCode=e||0,n$("exit",nS.exitCode,null),n$("afterexit",nS.exitCode,null),nD.call(nS,nS.exitCode));},nk=nS.emit,nj=function(e,t){if(!("exit"===e&&nI(M.process)))return nk.apply(this,arguments);void 0!==t&&(nS.exitCode=t);var r=nk.apply(this,arguments);return n$("exit",nS.exitCode,null),n$("afterexit",nS.exitCode,null),r;};}else nb=function(){return function(){};};"use strict";"use strict";const nM=(e,t,r,n)=>{if(!nG(t,r,n))return;let i=nB(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},nG=(e,{forceKillAfterTimeout:t},r)=>nF(e)&&!1!==t&&r,nF=e=>e===p.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),nB=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},nH=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},nq=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=nb(()=>{e.kill();});return n.finally(()=>{i();});};var nV=(nx={spawnedKill:(e,t="SIGTERM",r={})=>{let n=e(t);return nM(e,t,r,n),n;},spawnedCancel:(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},setupTimeout:(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{nH(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},validateTimeout:({timeout:e})=>{if(void 0!==e&&(!Number.isFin
${t}`,iH=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),iq=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),iV=(e,t,r)=>{let n=""===r?"":`with ${r.trim()}() `,i=iB.bind(null,n,t.toString());Object.defineProperty(i,"name",iq),Object.defineProperty(e,"toString",{...iH,value:i});},iX=new WeakMap(),iW=(e,t={})=>{let r;if("function"!=typeof e)throw TypeError("Expected a function");let n=0,i=e.displayName||e.name||"<anonymous>",o=function(...s){if(iX.set(o,++n),1===n)r=e.apply(this,s),e=null;else if(!0===t.throw)throw Error(`Function \`${i}\` can only be called once`);return r;};return function(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let n of Reflect.ownKeys(t))iM(e,t,n,r);iF(e,t),iV(e,t,n);}(o,e),iX.set(o,n),o;};iW.callCount=e=>{if(!iX.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return iX.get(e);};const iz=()=>Array.from({length:iQ-iY+1},iK),iK=(e,t)=>({name:`SIGRT${t+1}`,number:iY+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),iY=34,iQ=64,iJ=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"termina
${n.message}`:h,E=[v,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=u&&!c,n;},i5=["stdin","stdout","stderr"],i9=e=>i5.some(t=>void 0!==e[t]),i7=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return i5.map(t=>e[t]);if(i9(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${i5.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,i5.length);return Array.from({length:r},(e,r)=>t[r]);},oe=(e,t="SIGTERM",r={})=>{let n=e(t);return ot(e,t,r,n),n;},ot=(e,t,r,n)=>{if(!or(t,r,n))return;let i=oi(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},or=(e,{forceKillAfterTimeout:t},r)=>on(e)&&!1!==t&&r,on=e=>e===j(L).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),oi=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},oo=(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},os=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},oa=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{os(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},oc=({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);},ol=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=j(nb)(()=>{e.kill();});return n.finally(()=>{i();});};function ou(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe;}function od(e){return ou(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState;}const op=e=>e instanceof $.ChildProcess&&"function"==typeof e.then,of=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,b.createWriteStream)(r)),e;if(od(r))return e[t].pipe(r),e;if(!op(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!od(r.stdin))throw TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r;},om=e=>{null!==e.stdout&&(e.pipeStdout=of.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=of.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=of.bind(void 0,e,"all"));},oh=e=>{if(void 0!==e)throw TypeError("The `input` and `inputFile` options cannot be both set.");},og=({input:e,inputFile:t})=>"string"!=typeof t?e:(oh(e),(0,b.readFileSync)(t)),ov=e=>{let t=og(e);if(ou(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t;},oE=({input:e,inputFile:t})=>"string"!=typeof t?e:(oh(e),(0,b.createReadStream)(t)),oy=(e,t)=>{let r=oE(t);void 0!==r&&(ou(r)?r.pipe(e.stdin):e.stdin.end(r));},ow=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=j(n5)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},ox=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},ob=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?j(nZ)(e,{encoding:t,maxBuffer:n}):j(nZ).buffer(e,{maxBuffer:n});},oS=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=ob(e,{encoding:n,buffer:i,maxBuffer:o}),c=ob(t,{encoding:n,buffer:i,maxBuffer:o}),l=ob(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([s,a,c,l]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},ox(e,a),ox(t,c),ox(r,l)]);}},oI=(async()=>{})().constructor.prototype,oO=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(oI,e)]),oR=(e,t)=>{for(let[r,n]of oO){let i="function"==typ
`);},oH=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...j(A).env,...e}:e;return r?function({env:e=j(A).env,...t}={}){e={...e};let r=ij({env:e});return t.path=e[r],e[r]=function(e={}){let t;let{cwd:r=j(A).cwd(),path:n=j(A).env[ij()],execPath:i=j(A).execPath}=e,o=r instanceof URL?j(N).fileURLToPath(r):r,s=j(P).resolve(o),a=[];for(;t!==s;)a.push(j(P).join(s,"node_modules/.bin")),t=s,s=j(P).resolve(s,"..");return a.push(j(P).resolve(o,i,"..")),[...a,n].join(j(P).delimiter);}(t),e;}({env:o,cwd:n,execPath:i}):o;},oq=(e,t,r={})=>{let n=j(rM)._parse(e,t,r);return e=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||j(A).cwd(),execPath:j(A).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:oM,...r}).env=oH(r),r.stdio=i7(r),"win32"===j(A).platform&&"cmd"===j(P).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},oV=(e,t,r)=>"string"==typeof t||(0,_.Buffer).isBuffer(t)?e.stripFinalNewline?function(e){let t="string"==typeof e?"\n":"\n".charCodeAt(),r="string"==typeof e?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e;}(t):t:void 0===r?void 0:"";function oX(e,t,r){let n;let i=oq(e,t,r),o=oA(e,t),s=oN(e,t);oB(s,i.options),oc(i.options);try{n=j($).spawn(i.file,i.args,i.options);}catch(r){let e=new(j($).ChildProcess)(),t=Promise.reject(i8({error:r,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));return oR(e,t),e;}let a=oT(n),c=oa(n,i.options,a),l=ol(n,i.options,c),u={isCanceled:!1};n.kill=oe.bind(null,n.kill.bind(n)),n.cancel=oo.bind(null,n,u);let d=async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},c,d,p]=await oS(n,i.options,l),f=oV(i.options,c),m=oV(i.options,d),h=oV(i.options,p);if(e||0!==t||null!==r){let c=i8({error:e,exitCode:t,signal:r,stdout:f,stderr:m,all:h,command:o,escapedCommand:s,parsed:i,timedOut:a,isCanceled:u.isCanceled||!!i.options.signal&&i.options.signal.aborted,killed:n.killed});if(!i.options.reject)return c;throw c;}return{command:o,escapedCommand:s,exitCode:0,stdout:f,stderr:m,all:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};},p=iW(d);return oy(n,i.options),n.all=ow(n,i.options),om(n),oR(n,p),n;}function oW(e,t,r){let n;let i=oq(e,t,r),o=oA(e,t),s=oN(e,t);oB(s,i.options);let a=ov(i.options);try{n=j($).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throw i8({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let c=oV(i.options,n.stdout,n.error),l=oV(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=i8({stdout:c,stderr:l,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.error&&"ETIMEDOUT"===n.error.code,isCanceled:!1,killed:null!==n.signal});if(!i.options.reject)return e;throw e;}return{command:o,escapedCommand:s,exitCode:0,stdout:c,stderr:l,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};}const oz=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},oK=(e={})=>({preferLocal:!0,...oz(e),...e});function oY(t,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){return oX(function(){if(void 0===e){let t=j(rP).sync("pwsh",{nothrow:!0});null!==t&&(e=t);let r=j(rP).sync("powershell",{nothrow:!0});null!==r&&(e=r);}if(void 0===e)throw Error("Could not find powershell");return e;}(),[...r,"-c",t],n);}!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=oj(n,i);return oX(o,s,oK(t));}return r.sync=(e,...r)=>{if(!Array.isArray(e))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...i]=oj(e,r);return oW(n,i,oK(t));},r;}();var oQ={};const oJ="win32"!==p.platform(),oZ=p.release(),o0=/(\d+\.\d+)\.(\d+)/,o1=(e="",t="")=>/1\d+\.\d+/.test(e)&&Number(t)>=17134.1184;function o2(e){if(("linux"===process.platform||"darwin"===process.platform)&&ea()&&void 0!==process.env.SUDO_USER){let t=(0,m.statSync)(e).isDirect
2023-05-27 03:00:04 +08:00
export ${e}="${r}"
`),(0,rT.info)(`${e}="${r}" was added to "${o5}`);return;}process.env[e]=r;}async function o7(e){switch(process.platform){case"win32":await oY(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,rT.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":await st(),(0,m.appendFileSync)(o5,`
2023-05-27 03:00:04 +08:00
export PATH="${e}:$PATH"
`),(0,rT.info)(`"${e}" was added to "${o5}"`);return;default:return;}}let se=!1;async function st(){if(se)return;let e="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";if(await(0,o4.pathExists)(o5)){let t=(0,m.readFileSync)(o5,"utf8");if(t.includes(e))return;}(0,m.appendFileSync)(o5,`
2023-05-27 03:00:04 +08:00
${e}
`),(0,rT.info)(`Added ${e} to ${o5}`);let t=`
2023-05-27 03:00:04 +08:00
# source .cpprc if SOURCE_CPPRC is not set to 0
if [[ "$SOURCE_CPPRC" != 0 && -f "${o5}" ]]; then source "${o5}"; fi
`;try{let e=t8(".profile");(0,m.appendFileSync)(e,t),(0,rT.info)(`${t} was added to ${e}`);let r=t8(".bashrc");(0,m.appendFileSync)(r,t),(0,rT.info)(`${t} was added to ${r}`);}catch(e){(0,q.warning)(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${e}`);}se=!0;}async function sr(){if(await(0,o4.pathExists)(o5)){let e=(0,m.readFileSync)(o5,"utf-8").split("\n"),t=[...new Set(e.reverse())].reverse();(0,m.writeFileSync)(o5,t.join("\n"));try{o2(o5);}catch{}}}var sn={},si=f.join,so=f.delimiter,ss=f.sep,sa=f.posix;const sc="win32"===process.platform,sl=new RegExp(`[${sa.sep}${ss===sa.sep?"":ss}]`.replace(/(\\)/g,"\\$1")),su=RegExp(`^\\.${sl.source}`),sd=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),sp=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=so})=>{let i=e.match(sl)?[""]:[...(sc?[process.cwd()]:[]),...(t||"").split(n)];if(sc){let t=r||[".EXE",".CMD",".BAT",".COM"].join(n),o=t.split(n).reduce((e,t)=>(e.push(t),e.push(t.toLowerCase()),e),[]);return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t};}return{pathEnv:i,pathExt:[""]};},sf=(e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e,n=!r&&su.test(t)?t.slice(0,2):"";return n+si(r,t);},sm=async(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=sp(e,t),o=[];for(let s of r){let r=sf(s,e);for(let e of n){let n=r+e,s=await rN(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)return n;o.push(n);}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sd(e);};sn=sm,sm.sync=(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=sp(e,t),o=[];for(let s of r){let r=sf(s,e);for(let e of n){let n=r+e,s=rN.sync(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)return n;o.push(n);}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sd(e);};var o4=B("3WkGD"),sh=B("9O4vc"),q=B("hHq4F");const{appendFile:sg}=m.promises;let sv=!1,sE=!1;async function sy(e,t=!1){var r;let n=null!==j(sn).sync("nala",{nothrow:!0})?"nala":"apt-get";for(let{name:t,version:r}of e)(0,q.info)(`Installing ${t} ${null!=r?r:""} via ${n}`);process.env.DEBIAN_FRONTEND="noninteractive",(!sv||t)&&(sx(n),sv=!0),sE||(await sb(n),sE=!0);let i=[...new Set(e.flatMap(e=>null!==(r=e.repositories)&&void 0!==r?r:[]))];if(0!==i.length){for(let e of i)i$("add-apt-repository",["-y",e]);sx(n);}let o=await Promise.all(e.map(e=>sw(e.name,e.version)));return i$(n,["install","--fix-broken","-y",...o]),{binDir:"/usr/bin/"};}async function sw(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await oX("apt-cache",["search","--names-only",`^${(0,sh.default)(e)}-${(0,sh.default)(t)}$`]);if(""!==r.trim())return`${e}-${t}`;try{let{stdout:r}=await oX("apt-cache",["show",`${e}=${t}`]);if(""===r.trim())return`${e}=${t}`;}catch{}(0,q.warning)(`Failed to install ${e} ${t} via apt, trying without version`);}return e;}function sx(e){i$(e,"nala"!==e?["update","-y"]:["update"]);}async function sb(e){i$(e,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]);let t=[sI(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),sI(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(o6("LANG","C.UTF-8"),o6("LC_ALL","C.UTF-8")),await Promise.all(t);}function sS(){i$("gpg",["-k"]);}async function sI(e,t,r="keyserver.ubuntu.com"){let n=`/etc/apt/trusted.gpg.d/${t}`;return(await(0,o4.pathExists)(n))||(sS(),await Promise.all(e.map(async e=>{await iA("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--keyserver",r,"--recv-keys",e]),await iA("chmod",["644",n]);}))),n;}async function sO(e,t){let r=`/etc/apt/trusted.gpg.d/${e}`;return(await(0,o4.pathExists)(r))||(sS(),await sy([{name:"curl"}],void 0),i$("bash",["-c",`curl -s ${t} | gpg --no-default-keyring --keyring gnupg-ring:${r} --import`]),i$("chmod",["644",r])),r;}async function sR(e,t){return H.GITHUB_ACTIONS?iA("update-alternatives",["--install",`/usr/bin/${e}`,e,t,"40"]):(await st(),sg(o5,`
2023-05-27 03:00:04 +08:00
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} 40; fi
`));}var rT=B("2heqc"),r_=(B("A8hFE"),B("A8hFE")),sT=B("kSdX3");async function sC(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=j(sn).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,r_.dirname)(i)};let o=j(f).join((0,p.tmpdir)(),"setup-cpp","brew");await(0,sT.mkdirP)(o),oW("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,f.join)(o,"install.sh");if("linux"===process.platform){let e=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return oW("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=s_(),await o8(t),{binDir:t};}function s_(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}let sP=!1;async function s$(e,t,r=[]){(0,rT.info)(`Installing ${e} ${null!=t?t:""} via brew`),sP&&null!==j(sn).sync("brew",{nothrow:!0})||(await sC("","",process.arch),sP=!0);let n=s_();return oW((0,r_.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}var o4=B("3WkGD"),r_=B("A8hFE");async function sA(e,t,n){var i;if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let o=j(sn).sync("choco",{nothrow:!0});if(null!==o)return{binDir:r=(0,r_.dirname)(o)};let s="powershell.exe",a=j(sn).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==a&&(s=a),oW(s,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});let c=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await o8(c);let l=j(sn).sync("choco",{nothrow:!0});if(r=null!==l?(0,r_.dirname)(l):`${null!==(i=process.env.ChocolateyInstall)&&void 0!==i?i:"C:/ProgramData/chocolatey"}/bin`,await(0,o4.pathExists)(r))return{binDir:r};}var rT=B("2heqc"),q=B("hHq4F");let sN=!1;async function sL(e,t,r=[]){var n;(0,rT.info)(`Installing ${e} ${null!=t?t:""} via chocolatey`),sN&&null!==j(sn).sync("choco",{nothrow:!0})||(await sA("","",process.arch),sN=!0);let i=process.env.PATH,o={...process.env};if(delete o.TMP,delete o.TEMP,delete o.Path,o.PATH=i,void 0!==t&&""!==t)oW("choco",["install","-y",e,`--version=${t}`,...r],{env:o,extendEnv:!1,stdio:"inherit"});else try{oW("choco",["install","-y",e,...r],{env:o,extendEnv:!1,stdio:"inherit"});}catch(t){if(t.message.includes("exit code 3010"))(0,q.notice)(`${e} might require a reboot for the completion of the installation.`);else throw t;}let s=`${null!==(n=process.env.ChocolateyInstall)&&void 0!==n?n:"C:/ProgramData/chocolatey"}/bin`;return await o8(s),{binDir:s};}function sD(){return"linux"===process.platform&&(void 0===a&&(a=null!==j(sn).sync("pacman",{nothrow:!0})),a);}function sU(){return"linux"===process.platform&&(void 0===c&&(c=null!==j(sn).sync("dnf",{nothrow:!0})),c);}function sk(e,t){if((0,q.info)(`Installing ${e} ${null!=t?t:""} via dnf`),void 0!==t&&""!==t)try{i$("dnf",["-y","install",`${e}-${t}`]);}catch(t){(0,q.warning)(`${t.toString()}
Installing the default version available via dnf`),i$("dnf",["-y","install",e]);}else i$("dnf",["-y","install",e]);return{binDir:"/usr/bin/"};}function sj(){return"linux"===process.platform&&(void 0===l&&(l=null!==j(sn).sync("apt-get",{nothrow:!0})),l);}async function sM(e,t,r){switch(process.platform){case"win32":return sL("bazelisk",e);case"darwin":return s$("bazelisk",e);case"linux":if(sD())throw Error("installing bazel on Arch linux is not supported yet");if(sU())return sk("dnf-plugins-core",void 0),i$("dnf",["copr","enable","vbatts/bazel"]),sk("bazel4",void 0);if(sj()){let t=await sO("bazel-archive-keyring.gpg","https://bazel.build/bazel-release.pub.gpg");return i$("bash",["-c",`echo "deb [arch=amd64 signed-by=${t}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),sy([{name:"bazel",version:e}],!0);}throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}var q=(B("hHq4F"),B("hHq4F"));let sG=!1,sF=!1;async function sB(e,t,r){(0,q.info)(`Installing ${e} ${null!=t?t:""} via pacman`);let n="pacman";sG||"yay"===r||(i$(n,["-Sy","--noconfirm"]),sG=!0),sF||(i$(n,["-S","--noconfirm","base-devel"]),sF=!0);let i=e=>i$(null!=r?r:n,["-S","--noconfirm",e]);if(void 0!==t&&""!==t){let r=await sq(n,e);if(r.includes(t))try{i(`${e}=${t}`);}catch{i(`${e}${t}`);}else(0,q.info)(`Failed to install ${e} ${t} via pacman, trying without version`),i(e);}else i(e);return{binDir:"/usr/bin/"};}const sH=/Version\s*:\s*(.*)/g;async function sq(e,t){let r=[];try{let{stdout:n}=await oX(e,["-Si",t]);for(let e of n.matchAll(sH))r.push(e[1]);}catch(e){(0,q.warning)(`Failed to get available versions for ${t}: ${e}`);}return r;}"use strict";var sV={},sX=f.resolve(__dirname,"../../node_modules/.pnpm/@actions+tool-cache@2.0.1/node_modules/@actions/tool-cache/lib"),sW=sV&&sV.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),sz=sV&&sV.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),sK=sV&&sV.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&sW(t,e,r);return sz(t,e),t;},sY=sV&&sV.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e));}catch(e){o(e);}}function a(e){try{c(n.throw(e));}catch(e){o(e);}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}c((n=n.apply(e,t||[])).next());});},sQ=sV&&sV.__importDefault||function(e){return e&&e.__esModule?e:{default:e};};Object.defineProperty(sV,"__esModule",{value:!0}),sV.evaluateVersions=sV.isExplicitVersion=sV.findFromManifest=sV.getManifestFromRepo=sV.findAllVersions=sV.find=sV.cacheFile=sV.cacheDir=sV.extractZip=sV.extractXar=sV.extractTar=sV.extract7z=sV.downloadTool=sV.HTTPError=void 0;"use strict";const sJ=sK(B("2heqc")),sZ=sK(B("kSdX3")),s0=sK(m),s1=sK(B("8kgpT")),s2=sK(p),s3=sK(f),s4=sK(B("aPbbM")),s6=sK(B("feUtB")),s8=sK(T),s5=sK(x),s9=sQ(B("bxsAi"));var s7=B("2mVwa"),ae={},at=ae&&ae.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),ar=ae&&ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),an=ae&&ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&at(t,e,r);return ar(t,e),t;},ai=ae&&ae.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e));}catch(e){o(e);}}function a(e){try{c(n.throw(e));}catch(e){o(e);}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}c((n=n.apply(e,t||[])).next());});};Object.definePr
- The installation directory is ${t.installDir}`),""!==t.binDir&&(r+=`
- The binary directory is ${t.binDir}`)),r;}var rT=B("2heqc"),q=B("hHq4F"),ak=B("l2nMb");async function lv(e,t,r,n,i,o,s){try{let{compiler:a,version:c}=function(e){let t=e.split("-"),r=t[0];if(1 in t){let e=t[1];return null!==j(ak)(e)||(0,q.info)(`Invalid semver version ${e} used for the compiler.`),{compiler:r,version:e};}return{compiler:r,version:void 0};}(e);switch((0,rT.startGroup)(`Installing ${a} ${null!=c?c:""}`),a){case"llvm":case"clang":case"clang++":{let e=await c$(aX("llvm",c,t),(0,f.join)(r,"llvm"),n);await o6("GCOV","llvm-cov gcov"),i.push(lg("llvm",e));break;}case"gcc":case"mingw":case"cygwin":case"msys":{let e=aX("gcc",c,t),s=await ci(e,(0,f.join)(r,"gcc"),n);o&&(await o6("CPPFLAGS","")),await function(e){let t=j(ak)(e),r=null!==t?j(a7)(t):e,n=""!==r?`gcov-${r}`:"gcov";return o6("GCOV",n);}(e),i.push(lg("gcc",s));break;}case"cl":case"msvc":case"msbuild":case"vs":case"visualstudio":case"visualcpp":case"visualc++":{let e=await ln(aX("msvc",c,t),(0,f.join)(r,"msvc"),n);o&&(await o6("CPPFLAGS","")),i.push(lg("msvc",e));break;}case"appleclang":case"applellvm":(0,rT.notice)("Assuming apple-clang is already installed"),await Promise.all([o6("CC","clang"),o6("CXX","clang++")]),i.push(lg("apple-clang",void 0));break;default:s.push(`Unsupported compiler ${a}`);}}catch(t){(0,q.error)(t),s.push(`Failed to install the ${e}`);}(0,rT.endGroup)();}(async function(e){var t,r;let n,i,o=Promise.resolve();H.GITHUB_ACTIONS||(o=rR(),process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS="true");let s=function(e,t){t=t||{};var r,n,i,o,s,a={_:[]},c=0,l=0,u=0,d=(e=e||[]).length;let p=void 0!==t.alias,f=void 0!==t.unknown,m=void 0!==t.default;if(t.alias=t.alias||{},t.string=rC(t.string),t.boolean=rC(t.boolean),p)for(r in t.alias)for(c=0,n=t.alias[r]=rC(t.alias[r]);c<n.length;c++)(t.alias[n[c]]=n.concat(r)).splice(c,1);for(c=t.boolean.length;c-->0;)for(l=(n=t.alias[t.boolean[c]]||[]).length;l-->0;)t.boolean.push(n[l]);for(c=t.string.length;c-->0;)for(l=(n=t.alias[t.string[c]]||[]).length;l-->0;)t.string.push(n[l]);if(m){for(r in t.default)if(o=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],void 0!==t[o])for(t[o].push(r),c=0;c<n.length;c++)t[o].push(n[c]);}let h=f?Object.keys(t.alias):[];for(c=0;c<d;c++){if("--"===(i=e[c])){a._=a._.concat(e.slice(++c));break;}for(l=0;l<i.length&&45===i.charCodeAt(l);l++);if(0===l)a._.push(i);else if("no-"===i.substring(l,l+3)){if(o=i.substring(l+3),f&&!~h.indexOf(o))return t.unknown(i);a[o]=!1;}else{for(u=l+1;u<i.length&&61!==i.charCodeAt(u);u++);for(o=i.substring(l,u),s=i.substring(++u)||c+1===d||45===(""+e[c+1]).charCodeAt(0)||e[++c],n=2===l?[o]:o,u=0;u<n.length;u++){if(o=n[u],f&&!~h.indexOf(o))return t.unknown("-".repeat(l)+o);!function(e,t,r,n){var i,o=e[t],s=~n.string.indexOf(t)?null==r||!0===r?"":String(r):"boolean"==typeof r?r:~n.boolean.indexOf(t)?"false"!==r&&("true"===r||(e._.push(0*(i=+r)==0?i:r),!!r)):0*(i=+r)==0?i:r;e[t]=null==o?s:Array.isArray(o)?o.concat(s):[o,s];}(a,o,u+1<n.length||s,t);}}}if(m)for(r in t.default)void 0===a[r]&&(a[r]=t.default[r]);if(p)for(r in a)for(n=t.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a;}(e,{string:lh,default:Object.fromEntries(lh.map(e=>[e,function(e){let t=(0,rT.getInput)(e.toLowerCase());if("false"!==t&&""!==t)return t;}(e)])),alias:{h:"help"},boolean:"help"});s.help&&((0,q.info)(`
2023-05-27 03:00:04 +08:00
setup-cpp [options]
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
Install all the tools required for building and testing C++/C projects.
--architecture the cpu architecture to install the tools for. By default it uses the current CPU architecture.
--compiler the <compiler> to install.
You can specify the version instead of specifying just the name e.g: --compiler 'llvm-13.0.0'
--$tool_name pass "true" or pass the <version> you would like to install for this tool. e.g. --conan true or --conan "1.42.1"
All the available tools:
`),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --vcvarsall, --cppcheck, --clangtidy, --clangformat"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --nala"},cache:{tools:"--cppcache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));let a=null!==(t=s.architecture)&&void 0!==t?t:process.arch,c=null!==(r=process.env.SETUP_CPP_DIR)&&void 0!==r?r:t8(""),l=[],u=[],d=W.create({autoloadLocales:!0});W.addLocale(j(z)),V.addLocale(j(X));let p=await c_();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!aW(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(s,["llvm","clangtidy","clangformat"]))return(0,q.error)("The same version must be used for llvm, clangformat and clangtidy"),1;sD()&&"string"==typeof s.cppcheck&&"string"==typeof s.gcovr&&((0,q.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await sB("python-pygments"));let f=!1;for(let e of lm){let t=s[e];void 0!==t&&(n=Date.now(),f=await lp(e,t,p,a,c,l,u),i=Date.now(),(0,q.info)(`took ${d.format(n,i)||"0 seconds"}`));}let m=s.compiler;if(void 0!==m){let e=Date.now();await lv(m,p,c,a,l,f,u);let t=Date.now();(0,q.info)(`took ${d.format(e,t)||"0 seconds"}`);}if(await sr(),0===l.length&&0===u.length)return(0,q.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(l.forEach(e=>(0,q.success)(e)),u.forEach(e=>(0,q.error)(e)),(0,q.info)("setup-cpp finished"),!H.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,q.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,q.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}return await o,0===u.length?0:1;})(process.argv).then(e=>{process.exitCode=e;}).catch(e=>{(0,q.error)("main() panicked!"),(0,q.error)(e),process.exitCode=1;});
//# sourceMappingURL=setup-cpp.js.map