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

38 lines
240 KiB
JavaScript
Raw Normal View History

2023-07-16 06:41:58 +08:00
#!/usr/bin/env node
2024-01-22 13:51:42 +08:00
let e,t,r,n,i,o,s,a;function l(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}function c(e){return e&&e.__esModule?e.default:e;}function u(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,n){u(e,t||{},function(e,t){e?n(e):r(t);});});}rL(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n);});}function p(e,t){let r;let n=e.options.env||process.env,i=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){}try{r=rP.sync(e.command,{path:n[rD({env:n})],pathExt:t?id.delimiter:void 0});}catch(e){}finally{s&&process.chdir(i);}return r&&(r=id.resolve(o?e.options.cwd:"",r)),r;}function d(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 f(e,t){return iq&&1===e&&!t.file?d(t.original,"spawn"):null;}function h(e,t,r){let n=r$(e,t,r),i=t6.spawn(n.command,n.args,n.options);return rF.hookChildProcess(i,n),i;}async function m(e,t){if(!e)throw Error("Expected a stream");let{maxBuffer:r}=t={maxBuffer:1/0,...t},n=ne(t);return await new Promise((t,i)=>{let o=e=>{e&&n.getBufferedLength()<=r9.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{await oE(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(new oy());});}),n.getBufferedValue();}function v(){var e;return((null===(e=process.getuid)||void 0===e?void 0:e.call(process))===0||!!process.env.CI)&&null!==c(rx).sync("sudo",{nothrow:!0});}function g(e,t=[],r=o$){if(!v())return rA.sync(e,w(t),r);{let n=y(e,t);return rA.commandSync(n,r);}}function E(e,t=[],r=o$){if(!v())return c(rA)(e,w(t),r);{let n=y(e,t);return rA.command(n,r);}}function y(e,t){return"sudo "+w([e,...t]).join(" ");}function w(e){return e.map(e=>`'${e}'`);}async function x(e){if(("linux"===c(rr).platform||"darwin"===c(rr).platform)&&v()&&void 0!==c(rr).env.SUDO_USER){let t=(0,ih.statSync)(e).isDirectory();await E("chown",[...(t?["-R"]:[]),c(rr).env.SUDO_USER,e],o$);}}function b(e){return v()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,id.join)("/Users/",process.env.SUDO_USER,e):(0,id.join)("/home/",process.env.SUDO_USER,e):function(e){if("string"!=typeof e)throw TypeError("Expected a string, got "+typeof e);return iE?e.replace(/^~(?=$|\/|\\)/,iE):e;}("~/"+e);}function S(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e));}catch(e){o(e);}}function a(e){try{l(n.throw(e));}catch(e){o(e);}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});}function I(e,t){function r(r){return function(l){return function(r){if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,r[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue;}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break;}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break;}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break;}o[2]&&a.ops.pop(),a.trys.pop();continue;}r=t.call(e,a);}catch(e){r=[6,e],i=0;}finally{n=o=0;}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0};}([r,l]);};}var n,i,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1];},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this;}),s;}async function R(){try{await c(nm)({pkg:c(n_)});}catch(e){(0,rv.warning)("Failed to check for updates: "+(e instanceof Error?e.message+e.stack:e));}}function O(e){return null==e?[]:Array.i
2023-07-16 06:41:58 +08:00
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
2024-01-22 13:51:42 +08:00
`),(0,nP.info)(`if not defined ${e} then ${e}="${n}" was added to "${sF}`)):((0,ih.appendFileSync)(sF,`
2023-07-16 06:41:58 +08:00
export ${e}="${n}"
2024-01-22 13:51:42 +08:00
`),(0,nP.info)(`${e}="${n}" was added to "${sF}`));return;}process.env[e]=n;}async function k(e){switch(process.platform){case"win32":await P(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,nP.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":await U(),(0,ih.appendFileSync)(sF,`
2023-07-16 06:41:58 +08:00
export PATH="${e}:$PATH"
2024-01-22 13:51:42 +08:00
`),(0,nP.info)(`"${e}" was added to "${sF}"`);return;default:return;}}async function U(){if(sM)return;let e="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";if((await(0,nk.pathExists)(sF))&&(0,ih.readFileSync)(sF,"utf8").includes(e))return;(0,ih.appendFileSync)(sF,`
2023-07-16 06:41:58 +08:00
${e}
2024-01-22 13:51:42 +08:00
`),(0,nP.info)(`Added ${e} to ${sF}`);let t=`
2023-07-16 06:41:58 +08:00
# source .cpprc if SOURCE_CPPRC is not set to 0
2024-01-22 13:31:35 +08:00
if [[ "$SOURCE_CPPRC" != 0 && -f "${sF}" ]]; then source "${sF}"; fi
2024-01-22 13:51:42 +08:00
`;try{let e=b(".profile");(0,ih.appendFileSync)(e,t),(0,nP.info)(`${t} was added to ${e}`);let r=b(".bashrc");(0,ih.appendFileSync)(r,t),(0,nP.info)(`${t} was added to ${r}`);}catch(e){(0,rv.warning)(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${e}`);}sM=!0;}async function j(){if(await(0,nk.pathExists)(sF)){let e=(0,ih.readFileSync)(sF,"utf-8").split("\n"),t=[...new Set(e.reverse())].reverse();(0,ih.writeFileSync)(sF,t.join("\n")),await x(sF);}}async function F(e,t=!1){var r;let n;let i=B()?"nala":"apt-get";for(let{name:t,version:r}of e)(0,rv.info)(`Installing ${t} ${null!=r?r:""} via ${i}`);process.env.DEBIAN_FRONTEND="noninteractive",(!sB||t)&&(H(i),sB=!0),sH||(await q(i),sH=!0);let o=[...new Set(e.flatMap(e=>null!==(r=e.repositories)&&void 0!==r?r:[]))];if(0!==o.length){for(let e of o)g("add-apt-repository",["-y",e]);H(i);}let s=await Promise.all(e.map(e=>G(e.name,e.version)));try{g(i,["install","--fix-broken","-y",...s]);}catch(e){if("stderr"in e){let t=e.stderr;sq.some(e=>t.includes(e))&&((0,rv.warning)(`Failed to install packages ${s}. Retrying...`),g(i,["install","--fix-broken","-y",...s]));}else throw e;}return{binDir:"/usr/bin/"};}async function M(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await $("apt-cache",["search","--names-only",`^${(0,nU.default)(e)}-${(0,nU.default)(t)}$`]);if(""!==r.trim())return nj.NameDashVersion;try{let{stdout:r}=await $("apt-cache",["show",`${e}=${t}`]);if(""===r.trim())return nj.NameEqualsVersion;}catch{}}try{let{stdout:t}=await $("apt-cache",["show",e]);if(""!==t.trim())return nj.Name;}catch{}return nj.None;}async function G(e,t){switch(await M(e,t)){case nj.NameDashVersion:return`${e}-${t}`;case nj.NameEqualsVersion:return`${e}=${t}`;case nj.Name:return e;case nj.None:default:throw Error(`Could not find package ${e} ${null!=t?t:""}`);}}function B(){return null!==c(rx).sync("nala",{nothrow:!0});}function H(e){g(e,"nala"!==e?["update","-y"]:["update"]);}async function q(e){g(e,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]);let t=[X(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),X(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(N("LANG","C.UTF-8",{shouldAddOnlyIfNotDefined:!0}),N("LC_ALL","C.UTF-8",{shouldAddOnlyIfNotDefined:!0})),await Promise.all(t);}function V(){g("gpg",["-k"]);}async function X(e,t,r="keyserver.ubuntu.com"){try{let n="/etc/apt/trusted.gpg.d/"+t;return(await(0,nk.pathExists)(n))||(V(),await Promise.all(e.map(async e=>{await E("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+n,"--keyserver",r,"--recv-keys",e]),await E("chmod",["644",n]);}))),n;}catch(e){(0,rv.warning)(`Failed to add apt key via server ${r}: ${e}`);return;}}async function z(e,t){let r="/etc/apt/trusted.gpg.d/"+e;return(await(0,nk.pathExists)(r))||(V(),await F([{name:"curl"},{name:"ca-certificates"}],void 0),await $("curl",["-s",t,"-o","/tmp/"+e]),g("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+r,"--import","/tmp/"+e]),g("chmod",["644",r])),r;}async function W(e,t){return rm.GITHUB_ACTIONS?E("update-alternatives",["--install","/usr/bin/"+e,e,t,"40"]):(await U(),sG(sF,`
2023-07-16 06:41:58 +08:00
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} 40; fi
2024-01-22 13:51:42 +08:00
`));}async function K(e){try{let{stdout:t}=await $("dpkg",["-l",e]);return t.split("\n").some(e=>e.startsWith("ii"));}catch{return!1;}}async function Y(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=c(rx).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,nF.dirname)(i)};let o=c(id).join((0,ip.tmpdir)(),"setup-cpp","brew");await(0,nM.mkdirP)(o),_("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,id.join)(o,"install.sh");return"linux"===process.platform&&(0,ih.readFileSync)(s,"utf-8").replace("#!/bin/bash",""),_("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=Q(),await L(t),{binDir:t};}function Q(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}async function J(e,t,r=[]){(0,nP.info)(`Installing ${e} ${null!=t?t:""} via brew`),sV&&null!==c(rx).sync("brew",{nothrow:!0})||(await Y("","",process.arch),sV=!0);let n=Q();return _((0,nF.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}async function Z(e,t,n){var i;if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let o=c(rx).sync("choco",{nothrow:!0});if(null!==o)return{binDir:r=(0,nF.dirname)(o)};let s="powershell.exe",a=c(rx).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==a&&(s=a),_(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 l=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await L(l);let u=c(rx).sync("choco",{nothrow:!0});if(r=null!==u?(0,nF.dirname)(u):`${null!==(i=process.env.ChocolateyInstall)&&void 0!==i?i:"C:/ProgramData/chocolatey"}/bin`,await(0,nk.pathExists)(r))return{binDir:r};}async function ee(e,t,r=[]){var n;(0,rv.info)(`Installing ${e} ${null!=t?t:""} via chocolatey`),sX&&null!==c(rx).sync("choco",{nothrow:!0})||(await Z("","",process.arch),sX=!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)_("choco",["install","-y",e,"--version="+t,...r],{env:o,extendEnv:!1,stdio:"inherit"});else try{_("choco",["install","-y",e,...r],{env:o,extendEnv:!1,stdio:"inherit"});}catch(t){if(t.message.includes("exit code 3010"))(0,rv.info)(`${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 L(s),{binDir:s};}function et(){return"linux"===process.platform&&(void 0===o&&(o=null!==c(rx).sync("pacman",{nothrow:!0})),o);}function er(){return"linux"===process.platform&&(void 0===s&&(s=null!==c(rx).sync("dnf",{nothrow:!0})),s);}async function en(e){for(let{name:t,version:r}of e)(0,rv.info)(`Installing ${t} ${null!=r?r:""} via dnf`);return g("dnf",["-y","install",...(await Promise.all(e.map(e=>ei(e.name,e.version))))]),{binDir:"/usr/bin/"};}async function ei(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await $("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{let{stdout:r}=await $("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;(0,rv.warning)(`Failed to install ${e} ${t} via dnf, trying without version`);}}return e;}function eo(){return"linux"===process.platform&&(void 0===a&&(a=null!==c(rx).sync("apt-get",{nothrow:!0})),a);}async function es(e,t,r){switch(process.platform){case"win32":return ee("bazelisk",e);case"darwin":return J("bazelisk",e);case"linux":if(et())throw Error("installing bazel on Arch linux is not supported yet");if(er())return await en([{name:"dnf-plugins-core"}]),g("dnf",["copr","enable","vbatts/bazel"]),en([{name:"bazel4"}]);if(eo()){let t=await z("bazel-archive-keyring.gpg","https://bazel.build/bazel-release.pub.gpg");return g("bash",["-c",`echo "deb [arch=amd64 signed-by=${t}] https://storage.googleapis.com
2023-07-16 06:41:58 +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.
--timeout the timeout for the installation of each tool in minutes. By default it is 10 minutes.
2023-07-16 06:41:58 +08:00
--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:
2024-01-22 13:51:42 +08:00
`),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 l=null!==(t=a.architecture)&&void 0!==t?t:process.arch,u=null!==(r=process.env.SETUP_CPP_DIR)&&void 0!==r?r:b(""),p=[],d=[],f=ry.create({autoloadLocales:!0});ry.addLocale(c(rw)),rg.addLocale(c(rE));let h=await al();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!eJ(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(a,["llvm","clangtidy","clangformat"]))return(0,rv.error)("The same version must be used for llvm, clangformat and clangtidy"),1;et()&&"string"==typeof a.cppcheck&&"string"==typeof a.gcovr&&((0,rv.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await ea("python-pygments"));let m=!1,v=!1;for(let e of ak){if(rm.isCI&&0!==d.length){v=!0;break;}let t=a[e];void 0!==t&&(i=Date.now(),m=await tS(e,t,h,l,u,p,d,6e4*parseFloat(null!==(n=a.timeout)&&void 0!==n?n:"20")),o=Date.now(),(0,rv.info)("took "+(f.format(i,o)||"0 seconds")));}if(!v){let e=a.compiler;if(void 0!==e){let t=Date.now();await tY(e,h,u,l,p,m,d);let r=Date.now();(0,rv.info)("took "+(f.format(t,r)||"0 seconds"));}}if(await j(),0===p.length&&0===d.length)return(0,rv.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(p.forEach(e=>(0,rv.success)(e)),d.forEach(e=>(0,rv.error)(e)),(0,rv.info)("setup-cpp finished"),!rm.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,rv.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,rv.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}return await s,0===d.length?0:1;}var tJ,tZ,t0,t1,t2,t4,t3,t6,t8,t5,t9,t7,re,rt,rr,rn,ri,ro,rs,ra,rl,rc,ru,rp,rd,rf,rh,rm,rv,rg,rE,ry,rw,rx,rb,rS,rI,rR,rO,rT,rA,rC,r$,r_,rP,rN,rL,rD,rk,rU,rj,rF,rM,rG,rB,rH,rq,rV,rX,rz,rW,rK,rY,rQ,rJ,rZ,r0,r1,r2,r4,r3,r6,r8,r5,r9,r7,ne,nt,nr,nn,ni,no,ns,na,nl,nc,nu,np,nd,nf,nh,nm,nv,ng,nE,ny,nw,nx,nb,nS,nI,nR,nO,nT,nA,nC,n$,n_,nP,nN,nL,nD,nk,nU,nj,nF,nM,nG,nB,nH,nq,nV,nX,nz,nW,nK,nY,nQ,nJ,nZ,n0,n1,n2,n4,n3,n6,n8,n5,n9,n7,ie,it,ir,ii,io,is,ia,il,ic,iu,ip=require("os"),id=require("path"),ih=require("fs"),im=require("crypto"),iv=require("http"),ig=require("https");require("net"),t0=require("tls"),t1=require("events"),t2=require("assert"),t4=require("util"),t3=require("fs"),t6=require("child_process"),t8=require("string_decoder"),t5=require("timers"),t9=require("os"),t7=require("fs/promises"),re=require("buffer"),rt=require("stream"),rr=require("process"),rn=require("buffer"),ri=require("path"),ro=require("child_process"),rs=require("process"),ra=require("url"),rl=require("util"),rc=require("url"),ru=require("console"),rp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},rd={},rf={},null==(rh=rp.parcelRequire810d)&&((rh=function(e){if(e in rd)return rd[e].exports;if(e in rf){var t=rf[e];delete rf[e];var r={id:e,exports:{}};return rd[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){rf[e]=t;},rp.parcelRequire810d=rh),rh.register("dAuy6",function(e,t){var r;function n(e){return"string"==typeof e?!!i[e]:"env"in e?i[e.env]&&i[e.env].includes(e.includes):"any"in e?e.any.some(function(e){return!!i[e];}):Object.keys(e).every(function(t){return i[t]===e[t];});}r=rh("5vZJI");let i=process.env;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]).ev
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);},e.exports.setOutput=function(e,t){if(process.env.GITHUB_OUTPUT)return a.issueFileCommand("OUTPUT",a.prepareKeyValueMessage(e,t));process.stdout.write(E.EOL),s.issueCommand("set-output",{name:e},l.toCommandValue(t));},e.exports.setCommandEcho=function(e){s.issue("echo",e?"on":"off");},e.exports.setFailed=function(e){process.exitCode=u.Failure,m(e);},e.exports.isDebug=function(){return"1"===process.env.RUNNER_DEBUG;},e.exports.debug=function(e){s.issueCommand("debug",{},e);},e.exports.error=m,e.exports.warning=function(e,t={}){s.issueCommand("warning",l.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.notice=function(e,t={}){s.issueCommand("notice",l.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.info=function(e){process.stdout.write(e+E.EOL);},e.exports.startGroup=v,e.exports.endGroup=g,e.exports.group=function(e,t){return o(this,void 0,void 0,function*(){let r;v(e);try{r=yield t();}finally{g();}return r;});},e.exports.saveState=function(e,t){if(process.env.GITHUB_STATE)return a.issueFileCommand("STATE",a.prepareKeyValueMessage(e,t));s.issueCommand("save-state",{name:e},l.toCommandValue(t));},e.exports.getState=function(e){return process.env["STATE_"+e]||"";},e.exports.getIDToken=function(e){return o(this,void 0,void 0,function*(){return yield c.OidcClient.getIDToken(e);});},p=rh("dV9Cu"),Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return p.summary;}}),p=rh("dV9Cu"),Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return p.markdownSummary;}}),d=rh("9i0tI"),Object.defineProperty(e.exports,"toPosixPath",{enumerable:!0,get:function(){return d.toPosixPath;}}),Object.defineProperty(e.exports,"toWin32Path",{enumerable:!0,get:function(){return d.toWin32Path;}}),Object.defineProperty(e.exports,"toPlatformPath",{enumerable:!0,get:function(){return d.toPlatformPath;}});}),rh.register("1g3mY",function(e,t){var r,n,i,o;function s(e,t,r){let n=new l(e,t,r);process.stdout.write(n.toString()+a.EOL);}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 a=i(ip);o=rh("5nnws"),e.exports.issueCommand=s,e.exports.issue=function(e,t=""){s(e,{},t);};class l{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}=${o.toCommandValue(n).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return t+("::"+(e=this.message,o.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")));}}}),rh.register("5nnws",function(e,t){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}:{};};}),rh.register("8prV6",function(e,t){var r,n,i,o,s;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(){re
Error Code : ${e.statusCode}
2024-01-22 13:51:42 +08:00
Error Message: ${e.message}`);})).result)||void 0===t?void 0:t.value;if(!n)throw Error("Response json body do not have ID Token field");return n;});}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;}),rh.register("eamjo",function(e,t){var r,n,i,o,s,a,l,c,u;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;},o=e.exports&&e.exports.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e));}catch(e){o(e);}}function a(e){try{l(n.throw(e));}catch(e){o(e);}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}l((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 p=i(iv),d=i(ig),f=i(rh("jnrYh")),h=i(rh("3RDK7"));(c=s=e.exports.HttpCodes||(e.exports.HttpCodes={}))[c.OK=200]="OK",c[c.MultipleChoices=300]="MultipleChoices",c[c.MovedPermanently=301]="MovedPermanently",c[c.ResourceMoved=302]="ResourceMoved",c[c.SeeOther=303]="SeeOther",c[c.NotModified=304]="NotModified",c[c.UseProxy=305]="UseProxy",c[c.SwitchProxy=306]="SwitchProxy",c[c.TemporaryRedirect=307]="TemporaryRedirect",c[c.PermanentRedirect=308]="PermanentRedirect",c[c.BadRequest=400]="BadRequest",c[c.Unauthorized=401]="Unauthorized",c[c.PaymentRequired=402]="PaymentRequired",c[c.Forbidden=403]="Forbidden",c[c.NotFound=404]="NotFound",c[c.MethodNotAllowed=405]="MethodNotAllowed",c[c.NotAcceptable=406]="NotAcceptable",c[c.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",c[c.RequestTimeout=408]="RequestTimeout",c[c.Conflict=409]="Conflict",c[c.Gone=410]="Gone",c[c.TooManyRequests=429]="TooManyRequests",c[c.InternalServerError=500]="InternalServerError",c[c.NotImplemented=501]="NotImplemented",c[c.BadGateway=502]="BadGateway",c[c.ServiceUnavailable=503]="ServiceUnavailable",c[c.GatewayTimeout=504]="GatewayTimeout",(u=a=e.exports.Headers||(e.exports.Headers={})).Accept="accept",u.ContentType="content-type",(l=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 m=[s.MovedPermanently,s.ResourceMoved,s.SeeOther,s.TemporaryRedirect,s.PermanentRedirect],v=[s.BadGateway,s.ServiceUnavailable,s.GatewayTimeout],g=["OPTIONS","GET","DELETE","HEAD"];class E extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,E.prototype);}}e.exports.HttpClientError=E;class y{constructor(e){this.message=e;}readBody(){return o(this,void 0,void 0,function*(){return new Promise(e=>o(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=y,e.exports.isHttps=function(e){return"https:"===new URL(e).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.requestOptions=r,r&&(null!=r.ignoreSslEr
${n.message}`:h,g=[v,t,e].filter(Boolean).join("\n");return m?(n.originalMessage=n.message,n.message=g):n=Error(g),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;},rY={};const i3=["stdin","stdout","stderr"],i6=e=>i3.some(t=>void 0!==e[t]),i8=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return i3.map(t=>e[t]);if(i6(e))throw Error("It's not possible to provide `stdio` in combination with one of "+i3.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,i3.length)},(e,r)=>t[r]);};(rY=i8).node=e=>{let t=i8(e);return"ipc"===t?"ipc":void 0===t||"string"==typeof t?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];},rQ={},rJ={};const i5=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(i5(rZ=rp.process)){var i9,i7=t2,oe=rh("dVIKq"),ot=/^win/i.test(rZ.platform),or=t1;"function"!=typeof or&&(or=or.EventEmitter),rZ.__signal_exit_emitter__?i9=rZ.__signal_exit_emitter__:((i9=rZ.__signal_exit_emitter__=new or()).count=0,i9.emitted={}),i9.infinite||(i9.setMaxListeners(1/0),i9.infinite=!0);var on=function(){os&&i5(rp.process)&&(os=!1,oe.forEach(function(e){try{rZ.removeListener(e,oo[e]);}catch(e){}}),rZ.emit=ou,rZ.reallyExit=ol,i9.count-=1);};(rJ=function(e,t){if(!i5(rp.process))return function(){};i7.equal(typeof e,"function","a callback must be provided for exit handler"),!1===os&&oa();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),i9.on(r,e),function(){i9.removeListener(r,e),0===i9.listeners("exit").length&&0===i9.listeners("afterexit").length&&on();};}).unload=on;var oi=function(e,t,r){i9.emitted[e]||(i9.emitted[e]=!0,i9.emit(e,t,r));},oo={};oe.forEach(function(e){oo[e]=function(){i5(rp.process)&&rZ.listeners(e).length===i9.count&&(on(),oi("exit",null,e),oi("afterexit",null,e),ot&&"SIGHUP"===e&&(e="SIGINT"),rZ.kill(rZ.pid,e));};}),rJ.signals=function(){return oe;};var os=!1,oa=function(){!os&&i5(rp.process)&&(os=!0,i9.count+=1,oe=oe.filter(function(e){try{return rZ.on(e,oo[e]),!0;}catch(e){return!1;}}),rZ.emit=op,rZ.reallyExit=oc);};rJ.load=oa;var ol=rZ.reallyExit,oc=function(e){i5(rp.process)&&(rZ.exitCode=e||0,oi("exit",rZ.exitCode,null),oi("afterexit",rZ.exitCode,null),ol.call(rZ,rZ.exitCode));},ou=rZ.emit,op=function(e,t){if(!("exit"===e&&i5(rp.process)))return ou.apply(this,arguments);void 0!==t&&(rZ.exitCode=t);var r=ou.apply(this,arguments);return oi("exit",rZ.exitCode,null),oi("afterexit",rZ.exitCode,null),r;};}else rJ=function(){return function(){};};const od=(e,t,r,n)=>{if(!of(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},om(r));i.unref&&i.unref();},of=(e,{forceKillAfterTimeout:t},r)=>oh(e)&&!1!==t&&r,oh=e=>e===ip.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),om=({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;},ov=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));};r0=(rQ={spawnedKill(e,t="SIGTERM",r={}){let n=e(t);return od(e,t,r,n),n;},spawnedCancel(e,t){e.kill()&&(t.isCanceled=!0);},setupTimeout(e,{timeout:t,killSignal:r="SIGTERM"},n){let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{ov(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},validateTimeout({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})`);},async setExitHandler(e,{cleanup:t,detached:r},n){if(!t||r)return n;let i=rJ(()=>{e.kill()
${t}`,oD=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ok=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),oU=(e,t,r)=>{let n=""===r?"":`with ${r.trim()}() `,i=oL.bind(null,n,t.toString());Object.defineProperty(i,"name",ok),Object.defineProperty(e,"toString",{...oD,value:i});},oj=new WeakMap(),oF=(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(oj.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))o_(e,t,n,r);oN(e,t),oU(e,t,n);}(o,e),oj.set(o,n),o;};oF.callCount=e=>{if(!oj.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return oj.get(e);},nN=oF;const oM=()=>Array.from({length:oH-oB+1},oG),oG=(e,t)=>({name:"SIGRT"+(t+1),number:oB+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),oB=34,oH=64,oq=[{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:"t
${n.message}`:h,g=[v,t,e].filter(Boolean).join("\n");return m?(n.originalMessage=n.message,n.message=g):n=Error(g),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;},oJ=["stdin","stdout","stderr"],oZ=e=>oJ.some(t=>void 0!==e[t]),o0=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return oJ.map(t=>e[t]);if(oZ(e))throw Error("It's not possible to provide `stdio` in combination with one of "+oJ.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,oJ.length)},(e,r)=>t[r]);},o1=(e,t="SIGTERM",r={})=>{let n=e(t);return o2(e,t,r,n),n;},o2=(e,t,r,n)=>{if(!o4(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},o6(r));i.unref&&i.unref();},o4=(e,{forceKillAfterTimeout:t},r)=>o3(e)&&!1!==t&&r,o3=e=>e===c(t9).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),o6=({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;},o8=(e,t)=>{e.kill()&&(t.isCanceled=!0);},o5=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},o9=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{o5(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},o7=({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})`);},se=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=c(rJ)(()=>{e.kill();});return n.finally(()=>{i();});},st=e=>e instanceof ro.ChildProcess&&"function"==typeof e.then,sr=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,t3.createWriteStream)(r)),e;if(C(r))return e[t].pipe(r),e;if(!st(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!C(r.stdin))throw TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r;},sn=e=>{null!==e.stdout&&(e.pipeStdout=sr.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=sr.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=sr.bind(void 0,e,"all"));},si=e=>{if(void 0!==e)throw TypeError("The `input` and `inputFile` options cannot be both set.");},so=({input:e,inputFile:t})=>"string"!=typeof t?e:(si(e),(0,t3.readFileSync)(t)),ss=e=>{let t=so(e);if(A(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t;},sa=({input:e,inputFile:t})=>"string"!=typeof t?e:(si(e),(0,t3.createReadStream)(t)),sl=(e,t)=>{let r=sa(t);void 0!==r&&(A(r)?r.pipe(e.stdin):e.stdin.end(r));},sc=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=c(nr)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},su=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},sp=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?c(r5)(e,{encoding:t,maxBuffer:n}):c(r5).buffer(e,{maxBuffer:n});},sd=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=sp(e,{encoding:n,buffer:i,maxBuffer:o}),l=sp(t,{encoding:n,buffer:i,maxBuffer:o}),c=sp(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([s,a,l,c]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},su(e,a),su(t,l),su(r,c)]);}},sf=(async()=>{})().constructor.prototype,sh=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(sf,e)]),sm=(e,t)=>{for(let[r,n]of sh){let i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},sv=e=>new Promise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error",e=>{r(e);}),e.stdin&&e.stdin.on("error",e=>{r(e)
`);},sC=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...c(rs).env,...e}:e;return r?function({env:e=c(rs).env,...t}={}){let r=T({env:e={...e}});return t.path=e[r],e[r]=function(e={}){let t;let{cwd:r=c(rs).cwd(),path:n=c(rs).env[T()],execPath:i=c(rs).execPath}=e,o=i instanceof URL?c(ra).fileURLToPath(i):i,s=r instanceof URL?c(ra).fileURLToPath(r):r,a=c(ri).resolve(s),l=[];for(;t!==a;)l.push(c(ri).join(a,"node_modules/.bin")),t=a,a=c(ri).resolve(a,"..");return l.push(c(ri).resolve(s,o,"..")),[...l,n].join(c(ri).delimiter);}(t),e;}({env:o,cwd:n,execPath:i}):o;},s$=(e,t,r={})=>{let n=c(rC)._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||c(rs).cwd(),execPath:c(rs).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:sR,...r}).env=sC(r),r.stdio=o0(r),"win32"===c(rs).platform&&"cmd"===c(ri).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},s_=(e,t,r)=>"string"==typeof t||(0,rn.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:"",sP=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},sN=(e={})=>({preferLocal:!0,...sP(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=sI(n,i);return $(o,s,sN(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]=sI(e,r);return _(n,i,sN(t));},r;}(),nL={};const sL="win32"!==ip.platform(),sD=ip.release(),sk=(e="",t="")=>/1\d+\.\d+/.test(e)&&+t>=17134.1184;nL=function(e){return sL?e.replace(/(\s+)/g,"\\$1"):sk(.../(\d+\.\d+)\.(\d+)/.exec(sD).splice(1))?e:e.replace(/(\s+)/g,"%20");},function(){var e,t;e=rh("8CJZb"),t=function(e){return e.split("").reverse().join("");},nD=function(r,n,i){var o;return(null==n&&(n="'"),null==i&&(i="\\"),"string"!=typeof r)?r:(o=RegExp("(["+e(n)+"])(?!"+e(i)+")","g"),t(t(r).replace(o,"$1"+i)));};}.call(nD={}),nk=rh("6t4SD");const sU={shouldEscapeSpace:!1,shouldAddOnlyIfNotDefined:!1},sj=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/],sF=b(".cpprc");let sM=!1;nk=rh("6t4SD"),nU=rh("f44Uw"),rv=rh("hHq4F");const{appendFile:sG}=ih.promises;let sB=!1,sH=!1;const sq=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];(tJ=nj||(nj={}))[tJ.NameDashVersion=0]="NameDashVersion",tJ[tJ.NameEqualsVersion=1]="NameEqualsVersion",tJ[tJ.Name=2]="Name",tJ[tJ.None=3]="None",nP=rh("1o3Gj"),nF=rh("eAXk4"),nF=rh("eAXk4"),nM=rh("zdagz");let sV=!1;nk=rh("6t4SD"),nF=rh("eAXk4"),rv=rh("hHq4F");let sX=!1;rv=rh("hHq4F"),rv=rh("hHq4F");let sz=!1,sW=!1;const sK=/Version\s*:\s*(.*)/g;nG={},nB=id.resolve(__dirname,"../../node_modules/@actions/tool-cache/lib"),nH=nG&&nG.__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];}),nq=nG&&nG.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),nV=nG&&nG.__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)&&nH(t,e,r);return nq(t,e),t;},nX=nG&&nG.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e));}catch(e){o(e);}}function a(e){try{l(n.throw(e));}catch(e){o(e);}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});},nz=nG&&nG.__importDefault||function(e){return e&&e.__esModule?e:{default:e};},Object.defineProperty(nG,"__esModule",{value:!0}),nG.evaluateVersions=nG.isExplicitVersion=nG.findFromManifest=nG.getManifestFromRepo=nG.
2023-07-16 06:41:58 +08:00
//# sourceMappingURL=setup-cpp.js.map