From 4e1a4618d7fa5b61372eb204773b32e5dafea23e Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Tue, 9 Jul 2024 21:14:40 +0530 Subject: [PATCH] Release v2-verbose --- __tests__/utils.test.ts | 6 +-- dist/index.js | 2 +- src/config.ts | 2 +- src/scripts/darwin.sh | 34 ++++++++-------- src/scripts/extensions/add_extensions.sh | 24 ++++++------ src/scripts/extensions/blackfire.sh | 6 +-- src/scripts/extensions/couchbase.sh | 8 ++-- src/scripts/extensions/cubrid.sh | 2 +- src/scripts/extensions/event.sh | 4 +- src/scripts/extensions/firebird.sh | 8 ++-- src/scripts/extensions/gearman.sh | 2 +- src/scripts/extensions/geos.sh | 2 +- src/scripts/extensions/http.ps1 | 8 ++-- src/scripts/extensions/http.sh | 6 +-- src/scripts/extensions/intl.sh | 2 +- src/scripts/extensions/ioncube.sh | 4 +- src/scripts/extensions/oci.sh | 4 +- src/scripts/extensions/phalcon.sh | 4 +- src/scripts/extensions/relay.sh | 6 +-- src/scripts/extensions/source.sh | 12 +++--- src/scripts/extensions/sqlsrv.ps1 | 4 +- src/scripts/extensions/zephir_parser.sh | 2 +- src/scripts/linux.sh | 50 ++++++++++++------------ src/scripts/tools/add_tools.ps1 | 14 +++---- src/scripts/tools/add_tools.sh | 16 ++++---- src/scripts/tools/blackfire.ps1 | 8 ++-- src/scripts/tools/blackfire.sh | 6 +-- src/scripts/tools/brew.sh | 8 ++-- src/scripts/tools/grpc_php_plugin.ps1 | 4 +- src/scripts/tools/grpc_php_plugin.sh | 6 +-- src/scripts/tools/ppa.sh | 10 ++--- src/scripts/tools/protoc.ps1 | 4 +- src/scripts/tools/protoc.sh | 2 +- src/scripts/tools/symfony.ps1 | 4 +- src/scripts/tools/symfony.sh | 2 +- src/scripts/unix.sh | 16 ++++---- src/scripts/win32.ps1 | 16 ++++---- src/utils.ts | 4 +- 38 files changed, 161 insertions(+), 161 deletions(-) diff --git a/__tests__/utils.test.ts b/__tests__/utils.test.ts index f64be9bf2..842e8b858 100644 --- a/__tests__/utils.test.ts +++ b/__tests__/utils.test.ts @@ -177,9 +177,9 @@ describe('Utils tests', () => { }); it('checking suppressOutput', async () => { - expect(await utils.suppressOutput('win32')).toEqual(' >$null 2>&1'); - expect(await utils.suppressOutput('linux')).toEqual(' >/dev/null 2>&1'); - expect(await utils.suppressOutput('darwin')).toEqual(' >/dev/null 2>&1'); + expect(await utils.suppressOutput('win32')).toEqual(' '); + expect(await utils.suppressOutput('linux')).toEqual(' '); + expect(await utils.suppressOutput('darwin')).toEqual(' '); expect(await utils.suppressOutput('openbsd')).toContain( 'Platform openbsd is not supported' ); diff --git a/dist/index.js b/dist/index.js index fffc3d186..ec48716ca 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1 +1 @@ -(()=>{var e={88:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.addINIValuesUnix=addINIValuesUnix;t.addINIValuesWindows=addINIValuesWindows;t.addINIValues=addINIValues;const o=s(r(918));async function addINIValuesUnix(e){const t=await o.CSVArray(e);let r="";await o.asyncForEach(t,(async function(e){r+="\n"+await o.addLog("$tick",e,"Added to php.ini","linux")}));return'echo "'+t.join("\n")+'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1'+r}async function addINIValuesWindows(e){const t=await o.CSVArray(e);let r="\n";await o.asyncForEach(t,(async function(e){r+=await o.addLog("$tick",e,"Added to php.ini","win32")+"\n"}));return'Add-Content "$php_dir\\php.ini" "'+t.join("\n")+'"'+r}async function addINIValues(e,t,r=false){let n="\n";switch(r){case true:n+=await o.stepLog("Add php.ini values",t)+await o.suppressOutput(t)+"\n";break;case false:default:n+=await o.stepLog("Add php.ini values",t)+"\n";break}switch(t){case"win32":return n+await addINIValuesWindows(e);case"darwin":case"linux":return n+await addINIValuesUnix(e);default:return await o.log("Platform "+t+" is not supported",t,"error")}}},5730:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.checkXdebugError=checkXdebugError;t.addCoverageXdebug=addCoverageXdebug;t.addCoveragePCOV=addCoveragePCOV;t.disableCoverage=disableCoverage;t.addCoverage=addCoverage;const o=s(r(918));const a=s(r(3390));const u=s(r(88));async function checkXdebugError(e,t){if(/^5\.[3-6]$|^7\.[0-1]$/.test(t)&&e=="xdebug3"||/^8\.[0-9]$/.test(t)&&e=="xdebug2"){return e+" is not supported on PHP "+t}return""}async function addCoverageXdebug(e,t,r,n){let i="\n";const s=await checkXdebugError(e,t);if(!s){i+=await a.addExtension(":pcov:false",t,r,true)+n;e=e=="xdebug3"?"xdebug":e;i+=await a.addExtension(e,t,r,true)+n;i+=await o.setVariable("xdebug_version","php -r \"echo phpversion('xdebug');\"",r);i+=await o.getCommand(r,"extension_log")+'xdebug "Xdebug $xdebug_version enabled as coverage driver"'}else{i+=await o.addLog("$cross",e,s,r)}return i}async function addCoveragePCOV(e,t,r){let n="\n";switch(true){default:n+=await a.addExtension(":xdebug:false",e,t,true)+r;n+=await a.addExtension("pcov",e,t,true)+r;n+=await u.addINIValues("pcov.enabled=1",t,true)+"\n";n+=await o.setVariable("pcov_version","php -r \"echo phpversion('pcov');\"",t);n+=await o.getCommand(t,"extension_log")+'pcov "PCOV $pcov_version enabled as coverage driver"';break;case/5\.[3-6]|7\.0/.test(e):n+=await o.addLog("$cross","pcov","PHP 7.1 or newer is required",t);break}return n}async function disableCoverage(e,t,r){let n="\n";n+=await a.addExtension(":pcov:false",e,t,true)+r;n+=await a.addExtension(":xdebug:false",e,t,true)+r;n+=await o.addLog("$tick","none","Disabled Xdebug and PCOV",t);return n}async function addCoverage(e,t,r){e=e.toLowerCase();const n="\n"+await o.stepLog("Setup Coverage",r);const i=await o.suppressOutput(r)+"\n";switch(e){case"pcov":return n+await addCoveragePCOV(t,r,i);case"xdebug":case"xdebug2":case"xdebug3":return n+await addCoverageXdebug(e,t,r,i);case"none":return n+await disableCoverage(t,r,i);default:return""}}},3390:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.addExtensionDarwin=addExtensionDarwin;t.addExtensionWindows=addExtensionWindows;t.addExtensionLinux=addExtensionLinux;t.addExtension=addExtension;const o=s(r(918));async function addExtensionDarwin(e,t){const r=await o.extensionArray(e);let n="\n";let i="";await o.asyncForEach(r,(async function(e){const r=t+e;const[s,a]=e.split("-");const u=await o.getExtensionPrefix(s);switch(true){case/^:/.test(s):i+="\ndisable_extension"+s.replace(/:/g," ");return;case/^none$/.test(s):n+="\ndisable_all_shared";return;case/.+-.+\/.+@.+/.test(e):n+=await o.parseExtensionSource(e,u);return;case/^(7\.4|8\.[0-3])relay(-v?\d+\.\d+\.\d+)?$/.test(r):case/^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(r):case/^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(e):case/^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(r):case/(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-3])phalcon5?/.test(r):case/(?{const i=new a.URL(e);const s={"User-Agent":`Mozilla/5.0 (${process.platform} ${process.arch}) setup-php`};if(t){s.authorization="Bearer "+t}const u={hostname:i.hostname,path:i.pathname,headers:s,agent:new o.Agent({keepAlive:false})};const c=o.get(u,(e=>{if(e.statusCode===200){let t="";e.setEncoding("utf8");e.on("data",(e=>t+=e));e.on("end",(()=>n({data:`${t}`})))}else if([301,302,303,307,308].includes(e.statusCode)){if(r>0&&e.headers.location){fetch(e.headers.location,t,r--).then(n)}else{n({error:`${e.statusCode}: Redirect error`})}}else{n({error:`${e.statusCode}: ${e.statusMessage}`})}}));c.end()}));return await n}},9039:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getScript=getScript;t.run=run;const a=o(r(1017));const u=o(r(7147));const c=r(1514);const d=s(r(2186));const l=s(r(88));const f=s(r(5730));const p=s(r(3390));const h=s(r(7740));const v=s(r(918));async function getScript(e){const t="https://setup-php.com/sponsor";const r=e+await v.scriptExtension(e);const n=a.default.join(__dirname,"../src/scripts",r);const i=n.replace(e,"run");process.env["fail_fast"]=await v.getInput("fail-fast",false);const s=await v.getInput("extensions",false);const o=await v.getInput("ini-values",false);const c=await v.getInput("coverage",false);const d=await v.getInput("tools",false);const m=await v.parseVersion(await v.readPHPVersion());const g=await v.parseIniFile(await v.getInput("ini-file",false));let w=await v.joins(".",n,m,g);if(s){w+=await p.addExtension(s,m,e)}w+=await h.addTools(d,m,e);if(c){w+=await f.addCoverage(c,m,e)}if(o){w+=await l.addINIValues(o,e)}w+="\n"+await v.stepLog(`Sponsor setup-php`,e);w+="\n"+await v.addLog("$tick","setup-php",t,e);u.default.writeFileSync(i,w,{mode:493});return i}async function run(){const e=process.platform;const t=await v.scriptTool(e);const r=await getScript(e);await(0,c.exec)(t+r)}(async()=>{await run()})().catch((e=>{d.setFailed(e.message)}))},5151:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.search=search;const o=s(r(4773));const a=s(r(2387));async function search(e,t){const r=await a.fetch(`https://repo.packagist.org/p2/${e}.json`);if(r.error||r.data==="[]"){return null}const n=JSON.parse(r["data"]);if(n&&n.packages){const r=n.packages[e];r.sort(((e,t)=>o.compareVersions(t.version,e.version)));const i=r.find((e=>{if(e?.require?.php){return e?.require?.php.split("|").some((e=>e&&o.satisfies(t+".0",e)))}return false}));return i?i.version:null}return null}},7740:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.functionRecord=void 0;t.getSemverVersion=getSemverVersion;t.getLatestVersion=getLatestVersion;t.getVersion=getVersion;t.getRelease=getRelease;t.filterList=filterList;t.getUrl=getUrl;t.getPharUrl=getPharUrl;t.addArchive=addArchive;t.addPackage=addPackage;t.addBlackfirePlayer=addBlackfirePlayer;t.addCastor=addCastor;t.addComposer=addComposer;t.addDeployer=addDeployer;t.addDevTools=addDevTools;t.addPECL=addPECL;t.addPhing=addPhing;t.addPhive=addPhive;t.addPHPUnitTools=addPHPUnitTools;t.addWPCLI=addWPCLI;t.getData=getData;t.addTools=addTools;const a=o(r(1017));const u=o(r(7147));const c=s(r(2387));const d=s(r(5151));const l=s(r(918));async function getSemverVersion(e){const t=e["version_prefix"]+e["version"];const r=`https://api.github.com/repos/${e["repository"]}/git/matching-refs/tags%2F${t}.`;const n=await l.readEnv("GITHUB_TOKEN")||await l.readEnv("COMPOSER_TOKEN");const i=await c.fetch(r,n);if(i.error||i.data==="[]"){e["error"]=i.error??`No version found with prefix ${t}.`;return e["version"]}else{const e=JSON.parse(i["data"]).reverse();const t=e.find((e=>/.*\d+.\d+.\d+$/.test(e["ref"])));const r=(t||e[0])["ref"].split("/").pop();return r.replace(/^v(\d)/,"$1")}}async function getLatestVersion(e){if(!e["version"]&&e["fetch_latest"]==="false"){return"latest"}const t=await c.fetch(`${e["github"]}/${e["repository"]}/releases.atom`);if(t["data"]){const e=[...t["data"].matchAll(/releases\/tag\/([a-zA-Z]*)?(\d+.\d+.\d+)"/g)].map((e=>e[2]));return e.sort(((e,t)=>e.localeCompare(t,undefined,{numeric:true}))).pop()||"latest"}return"latest"}async function getVersion(e,t){const r=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;const n=/^composer:(stable|preview|snapshot|[1|2])$/;const i=/[><=^~]+.*/;const s=/^\d+(\.\d+)?$/;t["version"]=e.replace(/v?(\d)/,"$1").replace(/\.x/,"");switch(true){case n.test(t["release"]):case r.test(t["version"]):case i.test(t["version"])&&t["type"]==="composer":return t["version"];case s.test(t["version"])&&t["type"]==="composer":t["release"]=`${t["tool"]}:${t["version"]}.*`;return`${t["version"]}.*`;case t["repository"]&&s.test(t["version"]):return await getSemverVersion(t);default:return t["version"].replace(/[><=^~]*/,"")}}async function getRelease(e,t){e=e.includes("/")?e.split("/")[1]:e;return e.includes(":")?[t["tool"],e.split(":")[1]].join(":"):t["tool"]}async function filterList(e){const t=/^composer($|:.*)/;const r=/^composer:?($|preview$|snapshot$|v?\d+(\.\d+)?$|v?\d+\.\d+\.\d+[\w-]*$)/;const n=e.filter((e=>r.test(e)));let i="composer";e=e.filter((e=>!t.test(e)));switch(true){case n[0]==undefined:break;default:i=n[n.length-1].replace(/v(\d\S*)/,"$1");break}e.unshift(i);return e}async function getUrl(e){if(e["version"]==="latest"){return[e["domain"],e["repository"],e["prefix"],e["version"],e["verb"],e["tool"]+e["extension"]].filter(Boolean).join("/")}else{return[e["domain"],e["repository"],e["prefix"],e["verb"],e["version_prefix"]+e["version"],e["tool"]+e["extension"]].filter(Boolean).join("/")}}async function getPharUrl(e){if(e["version"]==="latest"){return e["domain"]+"/"+e["tool"]+".phar"}else{return e["domain"]+"/"+e["tool"]+"-"+e["version_prefix"]+e["version"]+".phar"}}async function addArchive(e){return await l.getCommand(e["os"],"tool")+await l.joins(e["url"],e["tool"],e["version_parameter"])}async function addPackage(e){const t=await l.getCommand(e["os"],"composer_tool");const r=e["repository"].split("/");const n=await l.joins(r[1],e["release"],r[0]+"/",e["scope"]);return t+n}async function addBlackfirePlayer(e){switch(e["os"]){case"win32":return await l.addLog("$cross",e["tool"],e["tool"]+" is not a windows tool","win32");default:if(e["version"]=="latest"){if(/5\.[5-6]|7\.0/.test(e["php_version"])){e["version"]="1.9.3"}else if(/7\.[1-4]|8\.0/.test(e["php_version"])){e["version"]="1.22.0"}}e["url"]=await getPharUrl(e);return addArchive(e)}}async function addCastor(e){e["tool"]="castor."+e["os"].replace("win32","windows")+"-amd64";e["url"]=await getUrl(e);e["tool"]="castor";e["version_parameter"]=u.default.existsSync("castor.php")?e["version_parameter"]:"";return await addArchive(e)}async function addComposer(e){const t=e["version"].replace("latest","stable");const r=e["github"];const n=e["domain"];const i="https://dl.cloudsmith.io";const s=`composer-${e["php_version"]}-${t}.phar`;const o=`${r}/shivammathur/composer-cache/releases/latest/download/${s}`;const a=`${i}/public/shivammathur/composer-cache/raw/files/${s}`;const u=`${n}/download/latest-2.2.x/composer.phar`;const c=/^5\.[3-6]$|^7\.[0-1]$/.test(e["php_version"]);const d=`${n}/composer-${t}.phar`;let f=`${o},${a}`;let p=`${n}/composer.phar`;switch(true){case/^snapshot$/.test(t):p=c?u:p;break;case/^preview$|^2$/.test(t):p=c?u:d;break;case/^1$/.test(t):p=d;break;case/^\d+\.\d+\.\d+[\w-]*$/.test(e["version"]):f=`${r}/${e["repository"]}/releases/download/${e["version"]}/composer.phar`;p=d;break;default:p=c?u:d}const h=await l.readEnv("NO_TOOLS_CACHE")!=="true";e["url"]=h?`${f},${p}`:p;e["version_parameter"]=e["version"];return await addArchive(e)}async function addDeployer(e){if(e["version"]==="latest"){e["url"]=e["domain"]+"/deployer.phar"}else{const t=await c.fetch("https://deployer.org/manifest.json");const r=JSON.parse(t.data);const n=Object.keys(r).find((t=>r[t]["version"]===e["version"]));if(n){e["url"]=r[n]["url"]}else{return await l.addLog("$cross","deployer","Version missing in deployer manifest",e["os"])}}return await addArchive(e)}async function addDevTools(e){switch(e["os"]){case"linux":case"darwin":return"add_devtools "+e["tool"];case"win32":return await l.addLog("$tick",e["tool"],e["tool"]+" is not a windows tool","win32");default:return await l.log("Platform "+e["os"]+" is not supported",e["os"],"error")}}async function addPECL(e){return await l.getCommand(e["os"],"pecl")}async function addPhing(e){e["url"]=e["domain"]+"/get/phing-"+e["version"]+e["extension"];if(e["version"]!="latest"){[e["prefix"],e["verb"]]=["releases","download"];e["domain"]=e["github"];e["extension"]="-"+e["version"]+e["extension"];e["url"]+=","+await getUrl(e)}return await addArchive(e)}async function addPhive(e){switch(true){case/5\.[3-5]/.test(e["php_version"]):return await l.addLog("$cross","phive","Phive is not supported on PHP "+e["php_version"],e["os"]);case/5\.6|7\.0/.test(e["php_version"]):e["version"]="0.12.1";break;case/7\.1/.test(e["php_version"]):e["version"]="0.13.5";break;case/7\.2/.test(e["php_version"]):e["version"]="0.14.5";break;case/^latest$/.test(e["version"]):e["version"]=await getLatestVersion(e);break}e["extension"]="-"+e["version"]+e["extension"];e["url"]=await getUrl(e);return await addArchive(e)}async function addPHPUnitTools(e){if(e["version"]==="latest"){e["version"]=await d.search(e["packagist"],e["php_version"])??"latest"}e["url"]=await getPharUrl(e);return await addArchive(e)}async function addWPCLI(e){if(e["version"]==="latest"){e["uri"]="wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true";e["url"]=[e["domain"],e["uri"]].join("/")}else{e["extension"]="-"+e["version"]+e["extension"];e["url"]=await getUrl(e)}return await addArchive(e)}async function getData(e,t,r){const n=a.default.join(__dirname,"../src/configs/tools.json");const i=u.default.readFileSync(n,"utf8");const s=JSON.parse(i);e=e.replace(/\s+/g,"");const o=e.split(":");const c=o[0];const d=o[1];let l;if(Object.keys(s).includes(c)){l=s[c];l["tool"]=c}else{const e=Object.keys(s).find((e=>s[e]["alias"]==c));if(e){l=s[e];l["tool"]=e}else{l={tool:c.split("/")[1],repository:c,type:"composer"};l=!c.includes("/")?{tool:c}:l}}l["github"]="https://github.com";l["domain"]??=l["github"];l["extension"]??=".phar";l["os"]=r;l["php_version"]=t;l["packagist"]??=l["repository"];l["prefix"]=l["github"]===l["domain"]?"releases":"";l["verb"]=l["github"]===l["domain"]?"download":"";l["fetch_latest"]??="false";l["scope"]??="global";l["version_parameter"]=JSON.stringify(l["version_parameter"])||"";l["version_prefix"]??="";l["release"]=await getRelease(e,l);l["version"]=d?await getVersion(d,l):await getLatestVersion(l);return l}t.functionRecord={castor:addCastor,composer:addComposer,deployer:addDeployer,dev_tools:addDevTools,phive:addPhive,blackfire_player:addBlackfirePlayer,pecl:addPECL,phing:addPhing,phpunit:addPHPUnitTools,phpcpd:addPHPUnitTools,wp_cli:addWPCLI};async function addTools(e,r,n){let i="\n";if(e==="none"){return""}else{i+=await l.stepLog("Setup Tools",n)}const s=await filterList(await l.CSVArray(e));await l.asyncForEach(s,(async function(e){const s=await getData(e,r,n);i+="\n";switch(true){case s["error"]!==undefined:i+=await l.addLog("$cross",s["tool"],s["error"],s["os"]);break;case"phar"===s["type"]:s["url"]=await getUrl(s);i+=await addArchive(s);break;case"composer"===s["type"]:i+=await addPackage(s);break;case"custom-package"===s["type"]:i+=await l.customPackage(s["tool"].split("-")[0],"tools",s["version"],s["os"]);break;case"custom-function"===s["type"]:i+=await t.functionRecord[s["function"]](s);break;case/^none$/.test(s["tool"]):break;default:i+=await l.addLog("$cross",s["tool"],"Tool "+s["tool"]+" is not supported",s["os"]);break}}));return i}},918:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.readEnv=readEnv;t.getInput=getInput;t.getManifestURL=getManifestURL;t.parseVersion=parseVersion;t.parseIniFile=parseIniFile;t.asyncForEach=asyncForEach;t.color=color;t.log=log;t.stepLog=stepLog;t.addLog=addLog;t.extensionArray=extensionArray;t.CSVArray=CSVArray;t.getExtensionPrefix=getExtensionPrefix;t.suppressOutput=suppressOutput;t.getUnsupportedLog=getUnsupportedLog;t.getCommand=getCommand;t.joins=joins;t.scriptExtension=scriptExtension;t.scriptTool=scriptTool;t.customPackage=customPackage;t.parseExtensionSource=parseExtensionSource;t.readPHPVersion=readPHPVersion;t.setVariable=setVariable;const a=o(r(7147));const u=s(r(1017));const c=s(r(2186));const d=s(r(2387));async function readEnv(e){const t=e.toLowerCase();const r=e.toUpperCase();return process.env[e]||process.env[t]||process.env[r]||process.env[t.replace("_","-")]||process.env[r.replace("_","-")]||""}async function getInput(e,t){const r=c.getInput(e);const n=await readEnv(e);switch(true){case r!="":return r;case r==""&&n!="":return n;case r==""&&n==""&&t:throw new Error(`Input required and not supplied: ${e}`);default:return""}}async function getManifestURL(){return"https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/php-versions.json"}async function parseVersion(e){switch(true){case/^(latest|lowest|highest|nightly|\d+\.x)$/.test(e):return JSON.parse((await d.fetch(await getManifestURL()))["data"])[e];default:switch(true){case e.length>1:return e.slice(0,3);default:return e+".0"}}}async function parseIniFile(e){switch(true){case/^(production|development|none)$/.test(e):return e;case/php\.ini-(production|development)$/.test(e):return e.split("-")[1];default:return"production"}}async function asyncForEach(e,t){for(let r=0;r$null 2>&1";case"linux":case"darwin":return" >/dev/null 2>&1";default:return await log("Platform "+e+" is not supported",e,"error")}}async function getUnsupportedLog(e,t,r){return"\n"+await addLog("$cross",e,[e,"is not supported on PHP",t].join(" "),r)+"\n"}async function getCommand(e,t){switch(e){case"linux":case"darwin":return"add_"+t+" ";case"win32":return"Add-"+t.split("_").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("")+" ";default:return await log("Platform "+e+" is not supported",e,"error")}}async function joins(...e){return[...e].join(" ")}async function scriptExtension(e){switch(e){case"win32":return".ps1";case"linux":case"darwin":return".sh";default:return await log("Platform "+e+" is not supported",e,"error")}}async function scriptTool(e){switch(e){case"win32":return"pwsh ";case"linux":case"darwin":return"bash ";default:return await log("Platform "+e+" is not supported",e,"error")}}async function customPackage(e,t,r,n){const i=e.replace(/\d+|(pdo|pecl)[_-]/,"");const s=await scriptExtension(n);const o=u.join(__dirname,"../src/scripts/"+t+"/"+i+s);const a=await getCommand(n,i);return"\n. "+o+"\n"+a+r}async function parseExtensionSource(e,t){const r=/(\w+)-(\w+:\/\/.{1,253}(?:[.:][^:/\s]{2,63})+\/)?([\w.-]+)\/([\w.-]+)@(.+)/;const n=r.exec(e);n[2]=n[2]?n[2].slice(0,-1):"https://github.com";return await joins("\nadd_extension_from_source",...n.splice(1,n.length),t)}async function readPHPVersion(){const e=await getInput("php-version",false);if(e){return e}const t=await getInput("php-version-file",false)||".php-version";if(a.default.existsSync(t)){return a.default.readFileSync(t,"utf8").replace(/[\r\n]/g,"")}else if(t!==".php-version"){throw new Error(`Could not find '${t}' file.`)}const r="composer.lock";if(a.default.existsSync(r)){const e=JSON.parse(a.default.readFileSync(r,"utf8"));if(e["platform-overrides"]&&e["platform-overrides"]["php"]){return e["platform-overrides"]["php"]}}const n="composer.json";if(a.default.existsSync(n)){const e=JSON.parse(a.default.readFileSync(n,"utf8"));if(e["config"]&&e["config"]["platform"]&&e["config"]["platform"]["php"]){return e["config"]["platform"]["php"]}}return"latest"}async function setVariable(e,t,r){switch(r){case"win32":return"\n$"+e+" = "+t+"\n";case"linux":case"darwin":default:return"\n"+e+'="$('+t+')"\n'}}},5241:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const o=s(r(2037));const a=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+o.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const u="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=u+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${u}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const a=r(5241);const u=r(717);const c=r(5278);const d=s(r(2037));const l=s(r(1017));const f=r(8041);var p;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(p=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=c.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){return u.issueFileCommand("ENV",u.prepareKeyValueMessage(e,t))}a.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){u.issueFileCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${l.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return r}return r.trim()}t.getInput=getInput;function getMultilineInput(e,t){const r=getInput(e,t).split("\n").filter((e=>e!==""));if(t&&t.trimWhitespace===false){return r}return r.map((e=>e.trim()))}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const r=["true","True","TRUE"];const n=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(n.includes(i))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}t.getBooleanInput=getBooleanInput;function setOutput(e,t){const r=process.env["GITHUB_OUTPUT"]||"";if(r){return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(e,t))}process.stdout.write(d.EOL);a.issueCommand("set-output",{name:e},c.toCommandValue(t))}t.setOutput=setOutput;function setCommandEcho(e){a.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=p.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){a.issueCommand("debug",{},e)}t.debug=debug;function error(e,t={}){a.issueCommand("error",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.error=error;function warning(e,t={}){a.issueCommand("warning",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.warning=warning;function notice(e,t={}){a.issueCommand("notice",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.notice=notice;function info(e){process.stdout.write(e+d.EOL)}t.info=info;function startGroup(e){a.issue("group",e)}t.startGroup=startGroup;function endGroup(){a.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return o(this,void 0,void 0,(function*(){startGroup(e);let r;try{r=yield t()}finally{endGroup()}return r}))}t.group=group;function saveState(e,t){const r=process.env["GITHUB_STATE"]||"";if(r){return u.issueFileCommand("STATE",u.prepareKeyValueMessage(e,t))}a.issueCommand("save-state",{name:e},c.toCommandValue(t))}t.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}t.getState=getState;function getIDToken(e){return o(this,void 0,void 0,(function*(){return yield f.OidcClient.getIDToken(e)}))}t.getIDToken=getIDToken;var h=r(1327);Object.defineProperty(t,"summary",{enumerable:true,get:function(){return h.summary}});var v=r(1327);Object.defineProperty(t,"markdownSummary",{enumerable:true,get:function(){return v.markdownSummary}});var m=r(2981);Object.defineProperty(t,"toPosixPath",{enumerable:true,get:function(){return m.toPosixPath}});Object.defineProperty(t,"toWin32Path",{enumerable:true,get:function(){return m.toWin32Path}});Object.defineProperty(t,"toPlatformPath",{enumerable:true,get:function(){return m.toPlatformPath}})},717:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.prepareKeyValueMessage=t.issueFileCommand=void 0;const o=s(r(7147));const a=s(r(2037));const u=r(5840);const c=r(5278);function issueFileCommand(e,t){const r=process.env[`GITHUB_${e}`];if(!r){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!o.existsSync(r)){throw new Error(`Missing file at path: ${r}`)}o.appendFileSync(r,`${c.toCommandValue(t)}${a.EOL}`,{encoding:"utf8"})}t.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(e,t){const r=`ghadelimiter_${u.v4()}`;const n=c.toCommandValue(t);if(e.includes(r)){throw new Error(`Unexpected input: name should not contain the delimiter "${r}"`)}if(n.includes(r)){throw new Error(`Unexpected input: value should not contain the delimiter "${r}"`)}return`${e}<<${r}${a.EOL}${n}${a.EOL}${r}`}t.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.OidcClient=void 0;const i=r(6255);const s=r(5526);const o=r(2186);class OidcClient{static createHttpClient(e=true,t=10){const r={allowRetries:e,maxRetries:t};return new i.HttpClient("actions/oidc-client",[new s.BearerCredentialHandler(OidcClient.getRequestToken())],r)}static getRequestToken(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return e}static getIDTokenUrl(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return e}static getCall(e){var t;return n(this,void 0,void 0,(function*(){const r=OidcClient.createHttpClient();const n=yield r.getJson(e).catch((e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.message}`)}));const i=(t=n.result)===null||t===void 0?void 0:t.value;if(!i){throw new Error("Response json body do not have ID Token field")}return i}))}static getIDToken(e){return n(this,void 0,void 0,(function*(){try{let t=OidcClient.getIDTokenUrl();if(e){const r=encodeURIComponent(e);t=`${t}&audience=${r}`}o.debug(`ID token url is ${t}`);const r=yield OidcClient.getCall(t);o.setSecret(r);return r}catch(e){throw new Error(`Error message: ${e.message}`)}}))}}t.OidcClient=OidcClient},2981:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.toPlatformPath=t.toWin32Path=t.toPosixPath=void 0;const o=s(r(1017));function toPosixPath(e){return e.replace(/[\\]/g,"/")}t.toPosixPath=toPosixPath;function toWin32Path(e){return e.replace(/[/]/g,"\\")}t.toWin32Path=toWin32Path;function toPlatformPath(e){return e.replace(/[/\\]/g,o.sep)}t.toPlatformPath=toPlatformPath},1327:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.summary=t.markdownSummary=t.SUMMARY_DOCS_URL=t.SUMMARY_ENV_VAR=void 0;const i=r(2037);const s=r(7147);const{access:o,appendFile:a,writeFile:u}=s.promises;t.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";t.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return n(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const e=process.env[t.SUMMARY_ENV_VAR];if(!e){throw new Error(`Unable to find environment variable for $${t.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield o(e,s.constants.R_OK|s.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}this._filePath=e;return this._filePath}))}wrap(e,t,r={}){const n=Object.entries(r).map((([e,t])=>` ${e}="${t}"`)).join("");if(!t){return`<${e}${n}>`}return`<${e}${n}>${t}`}write(e){return n(this,void 0,void 0,(function*(){const t=!!(e===null||e===void 0?void 0:e.overwrite);const r=yield this.filePath();const n=t?u:a;yield n(r,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return n(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(e,t=false){this._buffer+=e;return t?this.addEOL():this}addEOL(){return this.addRaw(i.EOL)}addCodeBlock(e,t){const r=Object.assign({},t&&{lang:t});const n=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(n).addEOL()}addList(e,t=false){const r=t?"ol":"ul";const n=e.map((e=>this.wrap("li",e))).join("");const i=this.wrap(r,n);return this.addRaw(i).addEOL()}addTable(e){const t=e.map((e=>{const t=e.map((e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:t,data:r,colspan:n,rowspan:i}=e;const s=t?"th":"td";const o=Object.assign(Object.assign({},n&&{colspan:n}),i&&{rowspan:i});return this.wrap(s,r,o)})).join("");return this.wrap("tr",t)})).join("");const r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){const r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){const{width:n,height:i}=r||{};const s=Object.assign(Object.assign({},n&&{width:n}),i&&{height:i});const o=this.wrap("img",null,Object.assign({src:e,alt:t},s));return this.addRaw(o).addEOL()}addHeading(e,t){const r=`h${t}`;const n=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1";const i=this.wrap(n,e);return this.addRaw(i).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const r=Object.assign({},t&&{cite:t});const n=this.wrap("blockquote",e,r);return this.addRaw(n).addEOL()}addLink(e,t){const r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}}const c=new Summary;t.markdownSummary=c;t.summary=c},5278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toCommandProperties=t.toCommandValue=void 0;function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}t.toCommandValue=toCommandValue;function toCommandProperties(e){if(!Object.keys(e).length){return{}}return{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}}t.toCommandProperties=toCommandProperties},1514:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getExecOutput=t.exec=void 0;const a=r(1576);const u=s(r(8159));function exec(e,t,r){return o(this,void 0,void 0,(function*(){const n=u.argStringToArray(e);if(n.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const i=n[0];t=n.slice(1).concat(t||[]);const s=new u.ToolRunner(i,t,r);return s.exec()}))}t.exec=exec;function getExecOutput(e,t,r){var n,i;return o(this,void 0,void 0,(function*(){let s="";let o="";const u=new a.StringDecoder("utf8");const c=new a.StringDecoder("utf8");const d=(n=r===null||r===void 0?void 0:r.listeners)===null||n===void 0?void 0:n.stdout;const l=(i=r===null||r===void 0?void 0:r.listeners)===null||i===void 0?void 0:i.stderr;const stdErrListener=e=>{o+=c.write(e);if(l){l(e)}};const stdOutListener=e=>{s+=u.write(e);if(d){d(e)}};const f=Object.assign(Object.assign({},r===null||r===void 0?void 0:r.listeners),{stdout:stdOutListener,stderr:stdErrListener});const p=yield exec(e,t,Object.assign(Object.assign({},r),{listeners:f}));s+=u.end();o+=c.end();return{exitCode:p,stdout:s,stderr:o}}))}t.getExecOutput=getExecOutput},8159:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.argStringToArray=t.ToolRunner=void 0;const a=s(r(2037));const u=s(r(2361));const c=s(r(2081));const d=s(r(1017));const l=s(r(7351));const f=s(r(1962));const p=r(9512);const h=process.platform==="win32";class ToolRunner extends u.EventEmitter{constructor(e,t,r){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=t||[];this.options=r||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,t){const r=this._getSpawnFileName();const n=this._getSpawnArgs(e);let i=t?"":"[command]";if(h){if(this._isCmdFile()){i+=r;for(const e of n){i+=` ${e}`}}else if(e.windowsVerbatimArguments){i+=`"${r}"`;for(const e of n){i+=` ${e}`}}else{i+=this._windowsQuoteCmdArg(r);for(const e of n){i+=` ${this._windowsQuoteCmdArg(e)}`}}}else{i+=r;for(const e of n){i+=` ${e}`}}return i}_processLineBuffer(e,t,r){try{let n=t+e.toString();let i=n.indexOf(a.EOL);while(i>-1){const e=n.substring(0,i);r(e);n=n.substring(i+a.EOL.length);i=n.indexOf(a.EOL)}return n}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(h){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(h){if(this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const r of this.args){t+=" ";t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r)}t+='"';return[t]}}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let r=false;for(const n of e){if(t.some((e=>e===n))){r=true;break}}if(!r){return e}let n='"';let i=true;for(let t=e.length;t>0;t--){n+=e[t-1];if(i&&e[t-1]==="\\"){n+="\\"}else if(e[t-1]==='"'){i=true;n+='"'}else{i=false}}n+='"';return n.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let t='"';let r=true;for(let n=e.length;n>0;n--){t+=e[n-1];if(r&&e[n-1]==="\\"){t+="\\"}else if(e[n-1]==='"'){r=true;t+="\\"}else{r=false}}t+='"';return t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};t.outStream=e.outStream||process.stdout;t.errStream=e.errStream||process.stderr;return t}_getSpawnOptions(e,t){e=e||{};const r={};r.cwd=e.cwd;r.env=e.env;r["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){r.argv0=`"${t}"`}return r}exec(){return o(this,void 0,void 0,(function*(){if(!f.isRooted(this.toolPath)&&(this.toolPath.includes("/")||h&&this.toolPath.includes("\\"))){this.toolPath=d.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield l.which(this.toolPath,true);return new Promise(((e,t)=>o(this,void 0,void 0,(function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const r=this._cloneExecOptions(this.options);if(!r.silent&&r.outStream){r.outStream.write(this._getCommandString(r)+a.EOL)}const n=new ExecState(r,this.toolPath);n.on("debug",(e=>{this._debug(e)}));if(this.options.cwd&&!(yield f.exists(this.options.cwd))){return t(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const i=this._getSpawnFileName();const s=c.spawn(i,this._getSpawnArgs(r),this._getSpawnOptions(this.options,i));let o="";if(s.stdout){s.stdout.on("data",(e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!r.silent&&r.outStream){r.outStream.write(e)}o=this._processLineBuffer(e,o,(e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}}))}))}let u="";if(s.stderr){s.stderr.on("data",(e=>{n.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!r.silent&&r.errStream&&r.outStream){const t=r.failOnStdErr?r.errStream:r.outStream;t.write(e)}u=this._processLineBuffer(e,u,(e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}}))}))}s.on("error",(e=>{n.processError=e.message;n.processExited=true;n.processClosed=true;n.CheckComplete()}));s.on("exit",(e=>{n.processExitCode=e;n.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);n.CheckComplete()}));s.on("close",(e=>{n.processExitCode=e;n.processExited=true;n.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);n.CheckComplete()}));n.on("done",((r,n)=>{if(o.length>0){this.emit("stdline",o)}if(u.length>0){this.emit("errline",u)}s.removeAllListeners();if(r){t(r)}else{e(n)}}));if(this.options.input){if(!s.stdin){throw new Error("child process missing stdin")}s.stdin.end(this.options.input)}}))))}))}}t.ToolRunner=ToolRunner;function argStringToArray(e){const t=[];let r=false;let n=false;let i="";function append(e){if(n&&e!=='"'){i+="\\"}i+=e;n=false}for(let s=0;s0){t.push(i);i=""}continue}append(o)}if(i.length>0){t.push(i.trim())}return t}t.argStringToArray=argStringToArray;class ExecState extends u.EventEmitter{constructor(e,t){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!t){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=t;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=p.setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}},5526:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.PersonalAccessTokenCredentialHandler=t.BearerCredentialHandler=t.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.HttpClient=t.isHttps=t.HttpClientResponse=t.HttpClientError=t.getProxyUrl=t.MediaTypes=t.Headers=t.HttpCodes=void 0;const a=s(r(3685));const u=s(r(5687));const c=s(r(9835));const d=s(r(4294));var l;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(l=t.HttpCodes||(t.HttpCodes={}));var f;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(f=t.Headers||(t.Headers={}));var p;(function(e){e["ApplicationJson"]="application/json"})(p=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){const t=c.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const h=[l.MovedPermanently,l.ResourceMoved,l.SeeOther,l.TemporaryRedirect,l.PermanentRedirect];const v=[l.BadGateway,l.ServiceUnavailable,l.GatewayTimeout];const m=["OPTIONS","GET","DELETE","HEAD"];const g=10;const w=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}t.HttpClientError=HttpClientError;class HttpClientResponse{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())}))}))))}))}}t.HttpClientResponse=HttpClientResponse;function isHttps(e){const t=new URL(e);return t.protocol==="https:"}t.isHttps=isHttps;class HttpClient{constructor(e,t,r){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=e;this.handlers=t||[];this.requestOptions=r;if(r){if(r.ignoreSslError!=null){this._ignoreSslError=r.ignoreSslError}this._socketTimeout=r.socketTimeout;if(r.allowRedirects!=null){this._allowRedirects=r.allowRedirects}if(r.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=r.allowRedirectDowngrade}if(r.maxRedirects!=null){this._maxRedirects=Math.max(r.maxRedirects,0)}if(r.keepAlive!=null){this._keepAlive=r.keepAlive}if(r.allowRetries!=null){this._allowRetries=r.allowRetries}if(r.maxRetries!=null){this._maxRetries=r.maxRetries}}}options(e,t){return o(this,void 0,void 0,(function*(){return this.request("OPTIONS",e,null,t||{})}))}get(e,t){return o(this,void 0,void 0,(function*(){return this.request("GET",e,null,t||{})}))}del(e,t){return o(this,void 0,void 0,(function*(){return this.request("DELETE",e,null,t||{})}))}post(e,t,r){return o(this,void 0,void 0,(function*(){return this.request("POST",e,t,r||{})}))}patch(e,t,r){return o(this,void 0,void 0,(function*(){return this.request("PATCH",e,t,r||{})}))}put(e,t,r){return o(this,void 0,void 0,(function*(){return this.request("PUT",e,t,r||{})}))}head(e,t){return o(this,void 0,void 0,(function*(){return this.request("HEAD",e,null,t||{})}))}sendStream(e,t,r,n){return o(this,void 0,void 0,(function*(){return this.request(e,t,r,n)}))}getJson(e,t={}){return o(this,void 0,void 0,(function*(){t[f.Accept]=this._getExistingOrDefaultHeader(t,f.Accept,p.ApplicationJson);const r=yield this.get(e,t);return this._processResponse(r,this.requestOptions)}))}postJson(e,t,r={}){return o(this,void 0,void 0,(function*(){const n=JSON.stringify(t,null,2);r[f.Accept]=this._getExistingOrDefaultHeader(r,f.Accept,p.ApplicationJson);r[f.ContentType]=this._getExistingOrDefaultHeader(r,f.ContentType,p.ApplicationJson);const i=yield this.post(e,n,r);return this._processResponse(i,this.requestOptions)}))}putJson(e,t,r={}){return o(this,void 0,void 0,(function*(){const n=JSON.stringify(t,null,2);r[f.Accept]=this._getExistingOrDefaultHeader(r,f.Accept,p.ApplicationJson);r[f.ContentType]=this._getExistingOrDefaultHeader(r,f.ContentType,p.ApplicationJson);const i=yield this.put(e,n,r);return this._processResponse(i,this.requestOptions)}))}patchJson(e,t,r={}){return o(this,void 0,void 0,(function*(){const n=JSON.stringify(t,null,2);r[f.Accept]=this._getExistingOrDefaultHeader(r,f.Accept,p.ApplicationJson);r[f.ContentType]=this._getExistingOrDefaultHeader(r,f.ContentType,p.ApplicationJson);const i=yield this.patch(e,n,r);return this._processResponse(i,this.requestOptions)}))}request(e,t,r,n){return o(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const i=new URL(t);let s=this._prepareRequest(e,i,n);const o=this._allowRetries&&m.includes(e)?this._maxRetries+1:1;let a=0;let u;do{u=yield this.requestRaw(s,r);if(u&&u.message&&u.message.statusCode===l.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(u)){e=t;break}}if(e){return e.handleAuthentication(this,s,r)}else{return u}}let t=this._maxRedirects;while(u.message.statusCode&&h.includes(u.message.statusCode)&&this._allowRedirects&&t>0){const o=u.message.headers["location"];if(!o){break}const a=new URL(o);if(i.protocol==="https:"&&i.protocol!==a.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield u.readBody();if(a.hostname!==i.hostname){for(const e in n){if(e.toLowerCase()==="authorization"){delete n[e]}}}s=this._prepareRequest(e,a,n);u=yield this.requestRaw(s,r);t--}if(!u.message.statusCode||!v.includes(u.message.statusCode)){return u}a+=1;if(a{function callbackForResult(e,t){if(e){n(e)}else if(!t){n(new Error("Unknown error"))}else{r(t)}}this.requestRawWithCallback(e,t,callbackForResult)}))}))}requestRawWithCallback(e,t,r){if(typeof t==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let n=false;function handleResult(e,t){if(!n){n=true;r(e,t)}}const i=e.httpModule.request(e.options,(e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)}));let s;i.on("socket",(e=>{s=e}));i.setTimeout(this._socketTimeout||3*6e4,(()=>{if(s){s.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))}));i.on("error",(function(e){handleResult(e)}));if(t&&typeof t==="string"){i.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",(function(){i.end()}));t.pipe(i)}else{i.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,r){const n={};n.parsedUrl=t;const i=n.parsedUrl.protocol==="https:";n.httpModule=i?u:a;const s=i?443:80;n.options={};n.options.host=n.parsedUrl.hostname;n.options.port=n.parsedUrl.port?parseInt(n.parsedUrl.port):s;n.options.path=(n.parsedUrl.pathname||"")+(n.parsedUrl.search||"");n.options.method=e;n.options.headers=this._mergeHeaders(r);if(this.userAgent!=null){n.options.headers["user-agent"]=this.userAgent}n.options.agent=this._getAgent(n.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(n.options)}}return n}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,r){let n;if(this.requestOptions&&this.requestOptions.headers){n=lowercaseKeys(this.requestOptions.headers)[t]}return e[t]||n||r}_getAgent(e){let t;const r=c.getProxyUrl(e);const n=r&&r.hostname;if(this._keepAlive&&n){t=this._proxyAgent}if(this._keepAlive&&!n){t=this._agent}if(t){return t}const i=e.protocol==="https:";let s=100;if(this.requestOptions){s=this.requestOptions.maxSockets||a.globalAgent.maxSockets}if(r&&r.hostname){const e={maxSockets:s,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})};let n;const o=r.protocol==="https:";if(i){n=o?d.httpsOverHttps:d.httpsOverHttp}else{n=o?d.httpOverHttps:d.httpOverHttp}t=n(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:s};t=i?new u.Agent(e):new a.Agent(e);this._agent=t}if(!t){t=i?u.globalAgent:a.globalAgent}if(i&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){return o(this,void 0,void 0,(function*(){e=Math.min(g,e);const t=w*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),t)))}))}_processResponse(e,t){return o(this,void 0,void 0,(function*(){return new Promise(((r,n)=>o(this,void 0,void 0,(function*(){const i=e.message.statusCode||0;const s={statusCode:i,result:null,headers:{}};if(i===l.NotFound){r(s)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let o;let a;try{a=yield e.readBody();if(a&&a.length>0){if(t&&t.deserializeDates){o=JSON.parse(a,dateTimeDeserializer)}else{o=JSON.parse(a)}s.result=o}s.headers=e.message.headers}catch(e){}if(i>299){let e;if(o&&o.message){e=o.message}else if(a&&a.length>0){e=a}else{e=`Failed request: (${i})`}const t=new HttpClientError(e,i);t.result=s.result;n(t)}else{r(s)}}))))}))}}t.HttpClient=HttpClient;const lowercaseKeys=e=>Object.keys(e).reduce(((t,r)=>(t[r.toLowerCase()]=e[r],t)),{})},9835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.checkBypass=t.getProxyUrl=void 0;function getProxyUrl(e){const t=e.protocol==="https:";if(checkBypass(e)){return undefined}const r=(()=>{if(t){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(r){return new URL(r)}else{return undefined}}t.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}const t=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!t){return false}let r;if(e.port){r=Number(e.port)}else if(e.protocol==="http:"){r=80}else if(e.protocol==="https:"){r=443}const n=[e.hostname.toUpperCase()];if(typeof r==="number"){n.push(`${n[0]}:${r}`)}for(const e of t.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e))){if(n.some((t=>t===e))){return true}}return false}t.checkBypass=checkBypass},1962:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var a;Object.defineProperty(t,"__esModule",{value:true});t.getCmdPath=t.tryGetExecutablePath=t.isRooted=t.isDirectory=t.exists=t.READONLY=t.UV_FS_O_EXLOCK=t.IS_WINDOWS=t.unlink=t.symlink=t.stat=t.rmdir=t.rm=t.rename=t.readlink=t.readdir=t.open=t.mkdir=t.lstat=t.copyFile=t.chmod=void 0;const u=s(r(7147));const c=s(r(1017));a=u.promises,t.chmod=a.chmod,t.copyFile=a.copyFile,t.lstat=a.lstat,t.mkdir=a.mkdir,t.open=a.open,t.readdir=a.readdir,t.readlink=a.readlink,t.rename=a.rename,t.rm=a.rm,t.rmdir=a.rmdir,t.stat=a.stat,t.symlink=a.symlink,t.unlink=a.unlink;t.IS_WINDOWS=process.platform==="win32";t.UV_FS_O_EXLOCK=268435456;t.READONLY=u.constants.O_RDONLY;function exists(e){return o(this,void 0,void 0,(function*(){try{yield t.stat(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true}))}t.exists=exists;function isDirectory(e,r=false){return o(this,void 0,void 0,(function*(){const n=r?yield t.stat(e):yield t.lstat(e);return n.isDirectory()}))}t.isDirectory=isDirectory;function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(t.IS_WINDOWS){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}t.isRooted=isRooted;function tryGetExecutablePath(e,r){return o(this,void 0,void 0,(function*(){let n=undefined;try{n=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(n&&n.isFile()){if(t.IS_WINDOWS){const t=c.extname(e).toUpperCase();if(r.some((e=>e.toUpperCase()===t))){return e}}else{if(isUnixExecutable(n)){return e}}}const i=e;for(const s of r){e=i+s;n=undefined;try{n=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(n&&n.isFile()){if(t.IS_WINDOWS){try{const r=c.dirname(e);const n=c.basename(e).toUpperCase();for(const i of yield t.readdir(r)){if(n===i.toUpperCase()){e=c.join(r,i);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(n)){return e}}}}return""}))}t.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(e){e=e||"";if(t.IS_WINDOWS){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}function getCmdPath(){var e;return(e=process.env["COMSPEC"])!==null&&e!==void 0?e:`cmd.exe`}t.getCmdPath=getCmdPath},7351:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.findInPath=t.which=t.mkdirP=t.rmRF=t.mv=t.cp=void 0;const a=r(9491);const u=s(r(1017));const c=s(r(1962));function cp(e,t,r={}){return o(this,void 0,void 0,(function*(){const{force:n,recursive:i,copySourceDirectory:s}=readCopyOptions(r);const o=(yield c.exists(t))?yield c.stat(t):null;if(o&&o.isFile()&&!n){return}const a=o&&o.isDirectory()&&s?u.join(t,u.basename(e)):t;if(!(yield c.exists(e))){throw new Error(`no such file or directory: ${e}`)}const d=yield c.stat(e);if(d.isDirectory()){if(!i){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,a,0,n)}}else{if(u.relative(e,a)===""){throw new Error(`'${a}' and '${e}' are the same file`)}yield copyFile(e,a,n)}}))}t.cp=cp;function mv(e,t,r={}){return o(this,void 0,void 0,(function*(){if(yield c.exists(t)){let n=true;if(yield c.isDirectory(t)){t=u.join(t,u.basename(e));n=yield c.exists(t)}if(n){if(r.force==null||r.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(u.dirname(t));yield c.rename(e,t)}))}t.mv=mv;function rmRF(e){return o(this,void 0,void 0,(function*(){if(c.IS_WINDOWS){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield c.rm(e,{force:true,maxRetries:3,recursive:true,retryDelay:300})}catch(e){throw new Error(`File was unable to be removed ${e}`)}}))}t.rmRF=rmRF;function mkdirP(e){return o(this,void 0,void 0,(function*(){a.ok(e,"a path argument must be provided");yield c.mkdir(e,{recursive:true})}))}t.mkdirP=mkdirP;function which(e,t){return o(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(c.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return t}const r=yield findInPath(e);if(r&&r.length>0){return r[0]}return""}))}t.which=which;function findInPath(e){return o(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(c.IS_WINDOWS&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(u.delimiter)){if(e){t.push(e)}}}if(c.isRooted(e)){const r=yield c.tryGetExecutablePath(e,t);if(r){return[r]}return[]}if(e.includes(u.sep)){return[]}const r=[];if(process.env.PATH){for(const e of process.env.PATH.split(u.delimiter)){if(e){r.push(e)}}}const n=[];for(const i of r){const r=yield c.tryGetExecutablePath(u.join(i,e),t);if(r){n.push(r)}}return n}))}t.findInPath=findInPath;function readCopyOptions(e){const t=e.force==null?true:e.force;const r=Boolean(e.recursive);const n=e.copySourceDirectory==null?true:Boolean(e.copySourceDirectory);return{force:t,recursive:r,copySourceDirectory:n}}function cpDirRecursive(e,t,r,n){return o(this,void 0,void 0,(function*(){if(r>=255)return;r++;yield mkdirP(t);const i=yield c.readdir(e);for(const s of i){const i=`${e}/${s}`;const o=`${t}/${s}`;const a=yield c.lstat(i);if(a.isDirectory()){yield cpDirRecursive(i,o,r,n)}else{yield copyFile(i,o,n)}}yield c.chmod(t,(yield c.stat(e)).mode)}))}function copyFile(e,t,r){return o(this,void 0,void 0,(function*(){if((yield c.lstat(e)).isSymbolicLink()){try{yield c.lstat(t);yield c.unlink(t)}catch(e){if(e.code==="EPERM"){yield c.chmod(t,"0666");yield c.unlink(t)}}const r=yield c.readlink(e);yield c.symlink(r,t,c.IS_WINDOWS?"junction":null)}else if(!(yield c.exists(t))||r){yield c.copyFile(e,t)}}))}},4773:function(e,t){(function(e,r){true?r(t):0})(this,(function(e){"use strict";const t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;const validateAndParse=e=>{if(typeof e!=="string"){throw new TypeError("Invalid argument expected string")}const r=e.match(t);if(!r){throw new Error(`Invalid argument not valid semver ('${e}' received)`)}r.shift();return r};const isWildcard=e=>e==="*"||e==="x"||e==="X";const tryParse=e=>{const t=parseInt(e,10);return isNaN(t)?e:t};const forceType=(e,t)=>typeof e!==typeof t?[String(e),String(t)]:[e,t];const compareStrings=(e,t)=>{if(isWildcard(e)||isWildcard(t))return 0;const[r,n]=forceType(tryParse(e),tryParse(t));if(r>n)return 1;if(r{for(let r=0;r{const r=validateAndParse(e);const n=validateAndParse(t);const i=r.pop();const s=n.pop();const o=compareSegments(r,n);if(o!==0)return o;if(i&&s){return compareSegments(i.split("."),s.split("."))}else if(i||s){return i?-1:1}return 0};const compare=(e,t,n)=>{assertValidOperator(n);const i=compareVersions(e,t);return r[n].includes(i)};const r={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};const n=Object.keys(r);const assertValidOperator=e=>{if(typeof e!=="string"){throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`)}if(n.indexOf(e)===-1){throw new Error(`Invalid operator, expected one of ${n.join("|")}`)}};const satisfies=(e,t)=>{t=t.replace(/([><=]+)\s+/g,"$1");if(t.includes("||")){return t.split("||").some((t=>satisfies(e,t)))}else if(t.includes(" - ")){const[r,n]=t.split(" - ",2);return satisfies(e,`>=${r} <=${n}`)}else if(t.includes(" ")){return t.trim().replace(/\s{2,}/g," ").split(" ").every((t=>satisfies(e,t)))}const r=t.match(/^([<>=~^]+)/);const n=r?r[1]:"=";if(n!=="^"&&n!=="~")return compare(e,t,n);const[i,s,o,,a]=validateAndParse(e);const[u,c,d,,l]=validateAndParse(t);const f=[i,s,o];const p=[u,c!==null&&c!==void 0?c:"x",d!==null&&d!==void 0?d:"x"];if(l){if(!a)return false;if(compareSegments(f,p)!==0)return false;if(compareSegments(a.split("."),l.split("."))===-1)return false}const h=p.findIndex((e=>e!=="0"))+1;const v=n==="~"?2:h>1?h:1;if(compareSegments(f.slice(0,v),p.slice(0,v))!==0)return false;if(compareSegments(f.slice(v),p.slice(v))===-1)return false;return true};const validate=e=>typeof e==="string"&&/^[v\d]/.test(e)&&t.test(e);const validateStrict=e=>typeof e==="string"&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(e);e.compare=compare;e.compareVersions=compareVersions;e.satisfies=satisfies;e.validate=validate;e.validateStrict=validateStrict}))},4294:(e,t,r)=>{e.exports=r(4219)},4219:(e,t,r)=>{"use strict";var n=r(1808);var i=r(4404);var s=r(3685);var o=r(5687);var a=r(2361);var u=r(9491);var c=r(3837);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=s.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=s.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=o.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=o.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||s.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",(function onFree(e,r,n,i){var s=toOptions(r,n,i);for(var o=0,a=t.requests.length;o=this.maxSockets){i.requests.push(s);return}i.createSocket(s,(function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){i.emit("free",t,s)}function onCloseOrRemove(e){i.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var r=this;var n={};r.sockets.push(n);var i=mergeOptions({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){i.localAddress=e.localAddress}if(i.proxyAuth){i.headers=i.headers||{};i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")}d("making CONNECT request");var s=r.request(i);s.useChunkedEncodingByDefault=false;s.once("response",onResponse);s.once("upgrade",onUpgrade);s.once("connect",onConnect);s.once("error",onError);s.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,r){process.nextTick((function(){onConnect(e,t,r)}))}function onConnect(i,o,a){s.removeAllListeners();o.removeAllListeners();if(i.statusCode!==200){d("tunneling socket could not be established, statusCode=%d",i.statusCode);o.destroy();var u=new Error("tunneling socket could not be established, "+"statusCode="+i.statusCode);u.code="ECONNRESET";e.request.emit("error",u);r.removeSocket(n);return}if(a.length>0){d("got illegal response body from proxy");o.destroy();var u=new Error("got illegal response body from proxy");u.code="ECONNRESET";e.request.emit("error",u);r.removeSocket(n);return}d("tunneling connection has established");r.sockets[r.sockets.indexOf(n)]=o;return t(o)}function onError(t){s.removeAllListeners();d("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, "+"cause="+t.message);i.code="ECONNRESET";e.request.emit("error",i);r.removeSocket(n)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var r=this.requests.shift();if(r){this.createSocket(r,(function(e){r.request.onSocket(e)}))}};function createSecureSocket(e,t){var r=this;TunnelingAgent.prototype.createSocket.call(r,e,(function(n){var s=e.request.getHeader("host");var o=mergeOptions({},r.options,{socket:n,servername:s?s.replace(/:.*$/,""):e.host});var a=i.connect(0,o);r.sockets[r.sockets.indexOf(n)]=a;t(a)}))}function toOptions(e,t,r){if(typeof e==="string"){return{host:e,port:t,localAddress:r}}return e}function mergeOptions(e){for(var t=1,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"v1",{enumerable:true,get:function(){return n.default}});Object.defineProperty(t,"v3",{enumerable:true,get:function(){return i.default}});Object.defineProperty(t,"v4",{enumerable:true,get:function(){return s.default}});Object.defineProperty(t,"v5",{enumerable:true,get:function(){return o.default}});Object.defineProperty(t,"NIL",{enumerable:true,get:function(){return a.default}});Object.defineProperty(t,"version",{enumerable:true,get:function(){return u.default}});Object.defineProperty(t,"validate",{enumerable:true,get:function(){return c.default}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return d.default}});Object.defineProperty(t,"parse",{enumerable:true,get:function(){return l.default}});var n=_interopRequireDefault(r(8628));var i=_interopRequireDefault(r(6409));var s=_interopRequireDefault(r(5122));var o=_interopRequireDefault(r(9120));var a=_interopRequireDefault(r(5332));var u=_interopRequireDefault(r(1595));var c=_interopRequireDefault(r(6900));var d=_interopRequireDefault(r(8950));var l=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},4569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function md5(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return n.default.createHash("md5").update(e).digest()}var i=md5;t["default"]=i},5332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r="00000000-0000-0000-0000-000000000000";t["default"]=r},2746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e){if(!(0,n.default)(e)){throw TypeError("Invalid UUID")}let t;const r=new Uint8Array(16);r[0]=(t=parseInt(e.slice(0,8),16))>>>24;r[1]=t>>>16&255;r[2]=t>>>8&255;r[3]=t&255;r[4]=(t=parseInt(e.slice(9,13),16))>>>8;r[5]=t&255;r[6]=(t=parseInt(e.slice(14,18),16))>>>8;r[7]=t&255;r[8]=(t=parseInt(e.slice(19,23),16))>>>8;r[9]=t&255;r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255;r[11]=t/4294967296&255;r[12]=t>>>24&255;r[13]=t>>>16&255;r[14]=t>>>8&255;r[15]=t&255;return r}var i=parse;t["default"]=i},814:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;t["default"]=r},807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=rng;var n=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const i=new Uint8Array(256);let s=i.length;function rng(){if(s>i.length-16){n.default.randomFillSync(i);s=0}return i.slice(s,s+=16)}},5274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function sha1(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return n.default.createHash("sha1").update(e).digest()}var i=sha1;t["default"]=i},8950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const i=[];for(let e=0;e<256;++e){i.push((e+256).toString(16).substr(1))}function stringify(e,t=0){const r=(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase();if(!(0,n.default)(r)){throw TypeError("Stringified UUID is invalid")}return r}var s=stringify;t["default"]=s},8628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(807));var i=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let s;let o;let a=0;let u=0;function v1(e,t,r){let c=t&&r||0;const d=t||new Array(16);e=e||{};let l=e.node||s;let f=e.clockseq!==undefined?e.clockseq:o;if(l==null||f==null){const t=e.random||(e.rng||n.default)();if(l==null){l=s=[t[0]|1,t[1],t[2],t[3],t[4],t[5]]}if(f==null){f=o=(t[6]<<8|t[7])&16383}}let p=e.msecs!==undefined?e.msecs:Date.now();let h=e.nsecs!==undefined?e.nsecs:u+1;const v=p-a+(h-u)/1e4;if(v<0&&e.clockseq===undefined){f=f+1&16383}if((v<0||p>a)&&e.nsecs===undefined){h=0}if(h>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}a=p;u=h;o=f;p+=122192928e5;const m=((p&268435455)*1e4+h)%4294967296;d[c++]=m>>>24&255;d[c++]=m>>>16&255;d[c++]=m>>>8&255;d[c++]=m&255;const g=p/4294967296*1e4&268435455;d[c++]=g>>>8&255;d[c++]=g&255;d[c++]=g>>>24&15|16;d[c++]=g>>>16&255;d[c++]=f>>>8|128;d[c++]=f&255;for(let e=0;e<6;++e){d[c+e]=l[e]}return t||(0,i.default)(d)}var c=v1;t["default"]=c},6409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(5998));var i=_interopRequireDefault(r(4569));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const s=(0,n.default)("v3",48,i.default);var o=s;t["default"]=o},5998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=_default;t.URL=t.DNS=void 0;var n=_interopRequireDefault(r(8950));var i=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringToBytes(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(807));var i=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function v4(e,t,r){e=e||{};const s=e.random||(e.rng||n.default)();s[6]=s[6]&15|64;s[8]=s[8]&63|128;if(t){r=r||0;for(let e=0;e<16;++e){t[r+e]=s[e]}return t}return(0,i.default)(s)}var s=v4;t["default"]=s},9120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(5998));var i=_interopRequireDefault(r(5274));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const s=(0,n.default)("v5",80,i.default);var o=s;t["default"]=o},6900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(814));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function validate(e){return typeof e==="string"&&n.default.test(e)}var i=validate;t["default"]=i},1595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function version(e){if(!(0,n.default)(e)){throw TypeError("Invalid UUID")}return parseInt(e.substr(14,1),16)}var i=version;t["default"]=i},9491:e=>{"use strict";e.exports=require("assert")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},1576:e=>{"use strict";e.exports=require("string_decoder")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var s=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(9039);module.exports=r})(); \ No newline at end of file +(()=>{var e={88:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.addINIValuesUnix=addINIValuesUnix;t.addINIValuesWindows=addINIValuesWindows;t.addINIValues=addINIValues;const o=s(r(918));async function addINIValuesUnix(e){const t=await o.CSVArray(e);let r="";await o.asyncForEach(t,(async function(e){r+="\n"+await o.addLog("$tick",e,"Added to php.ini","linux")}));return'echo "'+t.join("\n")+'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" '+r}async function addINIValuesWindows(e){const t=await o.CSVArray(e);let r="\n";await o.asyncForEach(t,(async function(e){r+=await o.addLog("$tick",e,"Added to php.ini","win32")+"\n"}));return'Add-Content "$php_dir\\php.ini" "'+t.join("\n")+'"'+r}async function addINIValues(e,t,r=false){let n="\n";switch(r){case true:n+=await o.stepLog("Add php.ini values",t)+await o.suppressOutput(t)+"\n";break;case false:default:n+=await o.stepLog("Add php.ini values",t)+"\n";break}switch(t){case"win32":return n+await addINIValuesWindows(e);case"darwin":case"linux":return n+await addINIValuesUnix(e);default:return await o.log("Platform "+t+" is not supported",t,"error")}}},5730:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.checkXdebugError=checkXdebugError;t.addCoverageXdebug=addCoverageXdebug;t.addCoveragePCOV=addCoveragePCOV;t.disableCoverage=disableCoverage;t.addCoverage=addCoverage;const o=s(r(918));const a=s(r(3390));const u=s(r(88));async function checkXdebugError(e,t){if(/^5\.[3-6]$|^7\.[0-1]$/.test(t)&&e=="xdebug3"||/^8\.[0-9]$/.test(t)&&e=="xdebug2"){return e+" is not supported on PHP "+t}return""}async function addCoverageXdebug(e,t,r,n){let i="\n";const s=await checkXdebugError(e,t);if(!s){i+=await a.addExtension(":pcov:false",t,r,true)+n;e=e=="xdebug3"?"xdebug":e;i+=await a.addExtension(e,t,r,true)+n;i+=await o.setVariable("xdebug_version","php -r \"echo phpversion('xdebug');\"",r);i+=await o.getCommand(r,"extension_log")+'xdebug "Xdebug $xdebug_version enabled as coverage driver"'}else{i+=await o.addLog("$cross",e,s,r)}return i}async function addCoveragePCOV(e,t,r){let n="\n";switch(true){default:n+=await a.addExtension(":xdebug:false",e,t,true)+r;n+=await a.addExtension("pcov",e,t,true)+r;n+=await u.addINIValues("pcov.enabled=1",t,true)+"\n";n+=await o.setVariable("pcov_version","php -r \"echo phpversion('pcov');\"",t);n+=await o.getCommand(t,"extension_log")+'pcov "PCOV $pcov_version enabled as coverage driver"';break;case/5\.[3-6]|7\.0/.test(e):n+=await o.addLog("$cross","pcov","PHP 7.1 or newer is required",t);break}return n}async function disableCoverage(e,t,r){let n="\n";n+=await a.addExtension(":pcov:false",e,t,true)+r;n+=await a.addExtension(":xdebug:false",e,t,true)+r;n+=await o.addLog("$tick","none","Disabled Xdebug and PCOV",t);return n}async function addCoverage(e,t,r){e=e.toLowerCase();const n="\n"+await o.stepLog("Setup Coverage",r);const i=await o.suppressOutput(r)+"\n";switch(e){case"pcov":return n+await addCoveragePCOV(t,r,i);case"xdebug":case"xdebug2":case"xdebug3":return n+await addCoverageXdebug(e,t,r,i);case"none":return n+await disableCoverage(t,r,i);default:return""}}},3390:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.addExtensionDarwin=addExtensionDarwin;t.addExtensionWindows=addExtensionWindows;t.addExtensionLinux=addExtensionLinux;t.addExtension=addExtension;const o=s(r(918));async function addExtensionDarwin(e,t){const r=await o.extensionArray(e);let n="\n";let i="";await o.asyncForEach(r,(async function(e){const r=t+e;const[s,a]=e.split("-");const u=await o.getExtensionPrefix(s);switch(true){case/^:/.test(s):i+="\ndisable_extension"+s.replace(/:/g," ");return;case/^none$/.test(s):n+="\ndisable_all_shared";return;case/.+-.+\/.+@.+/.test(e):n+=await o.parseExtensionSource(e,u);return;case/^(7\.4|8\.[0-3])relay(-v?\d+\.\d+\.\d+)?$/.test(r):case/^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(r):case/^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(e):case/^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(r):case/(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-3])phalcon5?/.test(r):case/(?{const i=new a.URL(e);const s={"User-Agent":`Mozilla/5.0 (${process.platform} ${process.arch}) setup-php`};if(t){s.authorization="Bearer "+t}const u={hostname:i.hostname,path:i.pathname,headers:s,agent:new o.Agent({keepAlive:false})};const c=o.get(u,(e=>{if(e.statusCode===200){let t="";e.setEncoding("utf8");e.on("data",(e=>t+=e));e.on("end",(()=>n({data:`${t}`})))}else if([301,302,303,307,308].includes(e.statusCode)){if(r>0&&e.headers.location){fetch(e.headers.location,t,r--).then(n)}else{n({error:`${e.statusCode}: Redirect error`})}}else{n({error:`${e.statusCode}: ${e.statusMessage}`})}}));c.end()}));return await n}},9039:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getScript=getScript;t.run=run;const a=o(r(1017));const u=o(r(7147));const c=r(1514);const d=s(r(2186));const l=s(r(88));const f=s(r(5730));const p=s(r(3390));const h=s(r(7740));const v=s(r(918));async function getScript(e){const t="https://setup-php.com/sponsor";const r=e+await v.scriptExtension(e);const n=a.default.join(__dirname,"../src/scripts",r);const i=n.replace(e,"run");process.env["fail_fast"]=await v.getInput("fail-fast",false);const s=await v.getInput("extensions",false);const o=await v.getInput("ini-values",false);const c=await v.getInput("coverage",false);const d=await v.getInput("tools",false);const m=await v.parseVersion(await v.readPHPVersion());const g=await v.parseIniFile(await v.getInput("ini-file",false));let w=await v.joins(".",n,m,g);if(s){w+=await p.addExtension(s,m,e)}w+=await h.addTools(d,m,e);if(c){w+=await f.addCoverage(c,m,e)}if(o){w+=await l.addINIValues(o,e)}w+="\n"+await v.stepLog(`Sponsor setup-php`,e);w+="\n"+await v.addLog("$tick","setup-php",t,e);u.default.writeFileSync(i,w,{mode:493});return i}async function run(){const e=process.platform;const t=await v.scriptTool(e);const r=await getScript(e);await(0,c.exec)(t+r)}(async()=>{await run()})().catch((e=>{d.setFailed(e.message)}))},5151:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.search=search;const o=s(r(4773));const a=s(r(2387));async function search(e,t){const r=await a.fetch(`https://repo.packagist.org/p2/${e}.json`);if(r.error||r.data==="[]"){return null}const n=JSON.parse(r["data"]);if(n&&n.packages){const r=n.packages[e];r.sort(((e,t)=>o.compareVersions(t.version,e.version)));const i=r.find((e=>{if(e?.require?.php){return e?.require?.php.split("|").some((e=>e&&o.satisfies(t+".0",e)))}return false}));return i?i.version:null}return null}},7740:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.functionRecord=void 0;t.getSemverVersion=getSemverVersion;t.getLatestVersion=getLatestVersion;t.getVersion=getVersion;t.getRelease=getRelease;t.filterList=filterList;t.getUrl=getUrl;t.getPharUrl=getPharUrl;t.addArchive=addArchive;t.addPackage=addPackage;t.addBlackfirePlayer=addBlackfirePlayer;t.addCastor=addCastor;t.addComposer=addComposer;t.addDeployer=addDeployer;t.addDevTools=addDevTools;t.addPECL=addPECL;t.addPhing=addPhing;t.addPhive=addPhive;t.addPHPUnitTools=addPHPUnitTools;t.addWPCLI=addWPCLI;t.getData=getData;t.addTools=addTools;const a=o(r(1017));const u=o(r(7147));const c=s(r(2387));const d=s(r(5151));const l=s(r(918));async function getSemverVersion(e){const t=e["version_prefix"]+e["version"];const r=`https://api.github.com/repos/${e["repository"]}/git/matching-refs/tags%2F${t}.`;const n=await l.readEnv("GITHUB_TOKEN")||await l.readEnv("COMPOSER_TOKEN");const i=await c.fetch(r,n);if(i.error||i.data==="[]"){e["error"]=i.error??`No version found with prefix ${t}.`;return e["version"]}else{const e=JSON.parse(i["data"]).reverse();const t=e.find((e=>/.*\d+.\d+.\d+$/.test(e["ref"])));const r=(t||e[0])["ref"].split("/").pop();return r.replace(/^v(\d)/,"$1")}}async function getLatestVersion(e){if(!e["version"]&&e["fetch_latest"]==="false"){return"latest"}const t=await c.fetch(`${e["github"]}/${e["repository"]}/releases.atom`);if(t["data"]){const e=[...t["data"].matchAll(/releases\/tag\/([a-zA-Z]*)?(\d+.\d+.\d+)"/g)].map((e=>e[2]));return e.sort(((e,t)=>e.localeCompare(t,undefined,{numeric:true}))).pop()||"latest"}return"latest"}async function getVersion(e,t){const r=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;const n=/^composer:(stable|preview|snapshot|[1|2])$/;const i=/[><=^~]+.*/;const s=/^\d+(\.\d+)?$/;t["version"]=e.replace(/v?(\d)/,"$1").replace(/\.x/,"");switch(true){case n.test(t["release"]):case r.test(t["version"]):case i.test(t["version"])&&t["type"]==="composer":return t["version"];case s.test(t["version"])&&t["type"]==="composer":t["release"]=`${t["tool"]}:${t["version"]}.*`;return`${t["version"]}.*`;case t["repository"]&&s.test(t["version"]):return await getSemverVersion(t);default:return t["version"].replace(/[><=^~]*/,"")}}async function getRelease(e,t){e=e.includes("/")?e.split("/")[1]:e;return e.includes(":")?[t["tool"],e.split(":")[1]].join(":"):t["tool"]}async function filterList(e){const t=/^composer($|:.*)/;const r=/^composer:?($|preview$|snapshot$|v?\d+(\.\d+)?$|v?\d+\.\d+\.\d+[\w-]*$)/;const n=e.filter((e=>r.test(e)));let i="composer";e=e.filter((e=>!t.test(e)));switch(true){case n[0]==undefined:break;default:i=n[n.length-1].replace(/v(\d\S*)/,"$1");break}e.unshift(i);return e}async function getUrl(e){if(e["version"]==="latest"){return[e["domain"],e["repository"],e["prefix"],e["version"],e["verb"],e["tool"]+e["extension"]].filter(Boolean).join("/")}else{return[e["domain"],e["repository"],e["prefix"],e["verb"],e["version_prefix"]+e["version"],e["tool"]+e["extension"]].filter(Boolean).join("/")}}async function getPharUrl(e){if(e["version"]==="latest"){return e["domain"]+"/"+e["tool"]+".phar"}else{return e["domain"]+"/"+e["tool"]+"-"+e["version_prefix"]+e["version"]+".phar"}}async function addArchive(e){return await l.getCommand(e["os"],"tool")+await l.joins(e["url"],e["tool"],e["version_parameter"])}async function addPackage(e){const t=await l.getCommand(e["os"],"composer_tool");const r=e["repository"].split("/");const n=await l.joins(r[1],e["release"],r[0]+"/",e["scope"]);return t+n}async function addBlackfirePlayer(e){switch(e["os"]){case"win32":return await l.addLog("$cross",e["tool"],e["tool"]+" is not a windows tool","win32");default:if(e["version"]=="latest"){if(/5\.[5-6]|7\.0/.test(e["php_version"])){e["version"]="1.9.3"}else if(/7\.[1-4]|8\.0/.test(e["php_version"])){e["version"]="1.22.0"}}e["url"]=await getPharUrl(e);return addArchive(e)}}async function addCastor(e){e["tool"]="castor."+e["os"].replace("win32","windows")+"-amd64";e["url"]=await getUrl(e);e["tool"]="castor";e["version_parameter"]=u.default.existsSync("castor.php")?e["version_parameter"]:"";return await addArchive(e)}async function addComposer(e){const t=e["version"].replace("latest","stable");const r=e["github"];const n=e["domain"];const i="https://dl.cloudsmith.io";const s=`composer-${e["php_version"]}-${t}.phar`;const o=`${r}/shivammathur/composer-cache/releases/latest/download/${s}`;const a=`${i}/public/shivammathur/composer-cache/raw/files/${s}`;const u=`${n}/download/latest-2.2.x/composer.phar`;const c=/^5\.[3-6]$|^7\.[0-1]$/.test(e["php_version"]);const d=`${n}/composer-${t}.phar`;let f=`${o},${a}`;let p=`${n}/composer.phar`;switch(true){case/^snapshot$/.test(t):p=c?u:p;break;case/^preview$|^2$/.test(t):p=c?u:d;break;case/^1$/.test(t):p=d;break;case/^\d+\.\d+\.\d+[\w-]*$/.test(e["version"]):f=`${r}/${e["repository"]}/releases/download/${e["version"]}/composer.phar`;p=d;break;default:p=c?u:d}const h=await l.readEnv("NO_TOOLS_CACHE")!=="true";e["url"]=h?`${f},${p}`:p;e["version_parameter"]=e["version"];return await addArchive(e)}async function addDeployer(e){if(e["version"]==="latest"){e["url"]=e["domain"]+"/deployer.phar"}else{const t=await c.fetch("https://deployer.org/manifest.json");const r=JSON.parse(t.data);const n=Object.keys(r).find((t=>r[t]["version"]===e["version"]));if(n){e["url"]=r[n]["url"]}else{return await l.addLog("$cross","deployer","Version missing in deployer manifest",e["os"])}}return await addArchive(e)}async function addDevTools(e){switch(e["os"]){case"linux":case"darwin":return"add_devtools "+e["tool"];case"win32":return await l.addLog("$tick",e["tool"],e["tool"]+" is not a windows tool","win32");default:return await l.log("Platform "+e["os"]+" is not supported",e["os"],"error")}}async function addPECL(e){return await l.getCommand(e["os"],"pecl")}async function addPhing(e){e["url"]=e["domain"]+"/get/phing-"+e["version"]+e["extension"];if(e["version"]!="latest"){[e["prefix"],e["verb"]]=["releases","download"];e["domain"]=e["github"];e["extension"]="-"+e["version"]+e["extension"];e["url"]+=","+await getUrl(e)}return await addArchive(e)}async function addPhive(e){switch(true){case/5\.[3-5]/.test(e["php_version"]):return await l.addLog("$cross","phive","Phive is not supported on PHP "+e["php_version"],e["os"]);case/5\.6|7\.0/.test(e["php_version"]):e["version"]="0.12.1";break;case/7\.1/.test(e["php_version"]):e["version"]="0.13.5";break;case/7\.2/.test(e["php_version"]):e["version"]="0.14.5";break;case/^latest$/.test(e["version"]):e["version"]=await getLatestVersion(e);break}e["extension"]="-"+e["version"]+e["extension"];e["url"]=await getUrl(e);return await addArchive(e)}async function addPHPUnitTools(e){if(e["version"]==="latest"){e["version"]=await d.search(e["packagist"],e["php_version"])??"latest"}e["url"]=await getPharUrl(e);return await addArchive(e)}async function addWPCLI(e){if(e["version"]==="latest"){e["uri"]="wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true";e["url"]=[e["domain"],e["uri"]].join("/")}else{e["extension"]="-"+e["version"]+e["extension"];e["url"]=await getUrl(e)}return await addArchive(e)}async function getData(e,t,r){const n=a.default.join(__dirname,"../src/configs/tools.json");const i=u.default.readFileSync(n,"utf8");const s=JSON.parse(i);e=e.replace(/\s+/g,"");const o=e.split(":");const c=o[0];const d=o[1];let l;if(Object.keys(s).includes(c)){l=s[c];l["tool"]=c}else{const e=Object.keys(s).find((e=>s[e]["alias"]==c));if(e){l=s[e];l["tool"]=e}else{l={tool:c.split("/")[1],repository:c,type:"composer"};l=!c.includes("/")?{tool:c}:l}}l["github"]="https://github.com";l["domain"]??=l["github"];l["extension"]??=".phar";l["os"]=r;l["php_version"]=t;l["packagist"]??=l["repository"];l["prefix"]=l["github"]===l["domain"]?"releases":"";l["verb"]=l["github"]===l["domain"]?"download":"";l["fetch_latest"]??="false";l["scope"]??="global";l["version_parameter"]=JSON.stringify(l["version_parameter"])||"";l["version_prefix"]??="";l["release"]=await getRelease(e,l);l["version"]=d?await getVersion(d,l):await getLatestVersion(l);return l}t.functionRecord={castor:addCastor,composer:addComposer,deployer:addDeployer,dev_tools:addDevTools,phive:addPhive,blackfire_player:addBlackfirePlayer,pecl:addPECL,phing:addPhing,phpunit:addPHPUnitTools,phpcpd:addPHPUnitTools,wp_cli:addWPCLI};async function addTools(e,r,n){let i="\n";if(e==="none"){return""}else{i+=await l.stepLog("Setup Tools",n)}const s=await filterList(await l.CSVArray(e));await l.asyncForEach(s,(async function(e){const s=await getData(e,r,n);i+="\n";switch(true){case s["error"]!==undefined:i+=await l.addLog("$cross",s["tool"],s["error"],s["os"]);break;case"phar"===s["type"]:s["url"]=await getUrl(s);i+=await addArchive(s);break;case"composer"===s["type"]:i+=await addPackage(s);break;case"custom-package"===s["type"]:i+=await l.customPackage(s["tool"].split("-")[0],"tools",s["version"],s["os"]);break;case"custom-function"===s["type"]:i+=await t.functionRecord[s["function"]](s);break;case/^none$/.test(s["tool"]):break;default:i+=await l.addLog("$cross",s["tool"],"Tool "+s["tool"]+" is not supported",s["os"]);break}}));return i}},918:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.readEnv=readEnv;t.getInput=getInput;t.getManifestURL=getManifestURL;t.parseVersion=parseVersion;t.parseIniFile=parseIniFile;t.asyncForEach=asyncForEach;t.color=color;t.log=log;t.stepLog=stepLog;t.addLog=addLog;t.extensionArray=extensionArray;t.CSVArray=CSVArray;t.getExtensionPrefix=getExtensionPrefix;t.suppressOutput=suppressOutput;t.getUnsupportedLog=getUnsupportedLog;t.getCommand=getCommand;t.joins=joins;t.scriptExtension=scriptExtension;t.scriptTool=scriptTool;t.customPackage=customPackage;t.parseExtensionSource=parseExtensionSource;t.readPHPVersion=readPHPVersion;t.setVariable=setVariable;const a=o(r(7147));const u=s(r(1017));const c=s(r(2186));const d=s(r(2387));async function readEnv(e){const t=e.toLowerCase();const r=e.toUpperCase();return process.env[e]||process.env[t]||process.env[r]||process.env[t.replace("_","-")]||process.env[r.replace("_","-")]||""}async function getInput(e,t){const r=c.getInput(e);const n=await readEnv(e);switch(true){case r!="":return r;case r==""&&n!="":return n;case r==""&&n==""&&t:throw new Error(`Input required and not supplied: ${e}`);default:return""}}async function getManifestURL(){return"https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/php-versions.json"}async function parseVersion(e){switch(true){case/^(latest|lowest|highest|nightly|\d+\.x)$/.test(e):return JSON.parse((await d.fetch(await getManifestURL()))["data"])[e];default:switch(true){case e.length>1:return e.slice(0,3);default:return e+".0"}}}async function parseIniFile(e){switch(true){case/^(production|development|none)$/.test(e):return e;case/php\.ini-(production|development)$/.test(e):return e.split("-")[1];default:return"production"}}async function asyncForEach(e,t){for(let r=0;re.charAt(0).toUpperCase()+e.slice(1))).join("")+" ";default:return await log("Platform "+e+" is not supported",e,"error")}}async function joins(...e){return[...e].join(" ")}async function scriptExtension(e){switch(e){case"win32":return".ps1";case"linux":case"darwin":return".sh";default:return await log("Platform "+e+" is not supported",e,"error")}}async function scriptTool(e){switch(e){case"win32":return"pwsh ";case"linux":case"darwin":return"bash ";default:return await log("Platform "+e+" is not supported",e,"error")}}async function customPackage(e,t,r,n){const i=e.replace(/\d+|(pdo|pecl)[_-]/,"");const s=await scriptExtension(n);const o=u.join(__dirname,"../src/scripts/"+t+"/"+i+s);const a=await getCommand(n,i);return"\n. "+o+"\n"+a+r}async function parseExtensionSource(e,t){const r=/(\w+)-(\w+:\/\/.{1,253}(?:[.:][^:/\s]{2,63})+\/)?([\w.-]+)\/([\w.-]+)@(.+)/;const n=r.exec(e);n[2]=n[2]?n[2].slice(0,-1):"https://github.com";return await joins("\nadd_extension_from_source",...n.splice(1,n.length),t)}async function readPHPVersion(){const e=await getInput("php-version",false);if(e){return e}const t=await getInput("php-version-file",false)||".php-version";if(a.default.existsSync(t)){return a.default.readFileSync(t,"utf8").replace(/[\r\n]/g,"")}else if(t!==".php-version"){throw new Error(`Could not find '${t}' file.`)}const r="composer.lock";if(a.default.existsSync(r)){const e=JSON.parse(a.default.readFileSync(r,"utf8"));if(e["platform-overrides"]&&e["platform-overrides"]["php"]){return e["platform-overrides"]["php"]}}const n="composer.json";if(a.default.existsSync(n)){const e=JSON.parse(a.default.readFileSync(n,"utf8"));if(e["config"]&&e["config"]["platform"]&&e["config"]["platform"]["php"]){return e["config"]["platform"]["php"]}}return"latest"}async function setVariable(e,t,r){switch(r){case"win32":return"\n$"+e+" = "+t+"\n";case"linux":case"darwin":default:return"\n"+e+'="$('+t+')"\n'}}},5241:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const o=s(r(2037));const a=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+o.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const u="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=u+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${u}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const a=r(5241);const u=r(717);const c=r(5278);const d=s(r(2037));const l=s(r(1017));const f=r(8041);var p;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(p=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=c.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){return u.issueFileCommand("ENV",u.prepareKeyValueMessage(e,t))}a.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){u.issueFileCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${l.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return r}return r.trim()}t.getInput=getInput;function getMultilineInput(e,t){const r=getInput(e,t).split("\n").filter((e=>e!==""));if(t&&t.trimWhitespace===false){return r}return r.map((e=>e.trim()))}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const r=["true","True","TRUE"];const n=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(n.includes(i))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}t.getBooleanInput=getBooleanInput;function setOutput(e,t){const r=process.env["GITHUB_OUTPUT"]||"";if(r){return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(e,t))}process.stdout.write(d.EOL);a.issueCommand("set-output",{name:e},c.toCommandValue(t))}t.setOutput=setOutput;function setCommandEcho(e){a.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=p.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){a.issueCommand("debug",{},e)}t.debug=debug;function error(e,t={}){a.issueCommand("error",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.error=error;function warning(e,t={}){a.issueCommand("warning",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.warning=warning;function notice(e,t={}){a.issueCommand("notice",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.notice=notice;function info(e){process.stdout.write(e+d.EOL)}t.info=info;function startGroup(e){a.issue("group",e)}t.startGroup=startGroup;function endGroup(){a.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return o(this,void 0,void 0,(function*(){startGroup(e);let r;try{r=yield t()}finally{endGroup()}return r}))}t.group=group;function saveState(e,t){const r=process.env["GITHUB_STATE"]||"";if(r){return u.issueFileCommand("STATE",u.prepareKeyValueMessage(e,t))}a.issueCommand("save-state",{name:e},c.toCommandValue(t))}t.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}t.getState=getState;function getIDToken(e){return o(this,void 0,void 0,(function*(){return yield f.OidcClient.getIDToken(e)}))}t.getIDToken=getIDToken;var h=r(1327);Object.defineProperty(t,"summary",{enumerable:true,get:function(){return h.summary}});var v=r(1327);Object.defineProperty(t,"markdownSummary",{enumerable:true,get:function(){return v.markdownSummary}});var m=r(2981);Object.defineProperty(t,"toPosixPath",{enumerable:true,get:function(){return m.toPosixPath}});Object.defineProperty(t,"toWin32Path",{enumerable:true,get:function(){return m.toWin32Path}});Object.defineProperty(t,"toPlatformPath",{enumerable:true,get:function(){return m.toPlatformPath}})},717:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.prepareKeyValueMessage=t.issueFileCommand=void 0;const o=s(r(7147));const a=s(r(2037));const u=r(5840);const c=r(5278);function issueFileCommand(e,t){const r=process.env[`GITHUB_${e}`];if(!r){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!o.existsSync(r)){throw new Error(`Missing file at path: ${r}`)}o.appendFileSync(r,`${c.toCommandValue(t)}${a.EOL}`,{encoding:"utf8"})}t.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(e,t){const r=`ghadelimiter_${u.v4()}`;const n=c.toCommandValue(t);if(e.includes(r)){throw new Error(`Unexpected input: name should not contain the delimiter "${r}"`)}if(n.includes(r)){throw new Error(`Unexpected input: value should not contain the delimiter "${r}"`)}return`${e}<<${r}${a.EOL}${n}${a.EOL}${r}`}t.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.OidcClient=void 0;const i=r(6255);const s=r(5526);const o=r(2186);class OidcClient{static createHttpClient(e=true,t=10){const r={allowRetries:e,maxRetries:t};return new i.HttpClient("actions/oidc-client",[new s.BearerCredentialHandler(OidcClient.getRequestToken())],r)}static getRequestToken(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return e}static getIDTokenUrl(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return e}static getCall(e){var t;return n(this,void 0,void 0,(function*(){const r=OidcClient.createHttpClient();const n=yield r.getJson(e).catch((e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.message}`)}));const i=(t=n.result)===null||t===void 0?void 0:t.value;if(!i){throw new Error("Response json body do not have ID Token field")}return i}))}static getIDToken(e){return n(this,void 0,void 0,(function*(){try{let t=OidcClient.getIDTokenUrl();if(e){const r=encodeURIComponent(e);t=`${t}&audience=${r}`}o.debug(`ID token url is ${t}`);const r=yield OidcClient.getCall(t);o.setSecret(r);return r}catch(e){throw new Error(`Error message: ${e.message}`)}}))}}t.OidcClient=OidcClient},2981:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.toPlatformPath=t.toWin32Path=t.toPosixPath=void 0;const o=s(r(1017));function toPosixPath(e){return e.replace(/[\\]/g,"/")}t.toPosixPath=toPosixPath;function toWin32Path(e){return e.replace(/[/]/g,"\\")}t.toWin32Path=toWin32Path;function toPlatformPath(e){return e.replace(/[/\\]/g,o.sep)}t.toPlatformPath=toPlatformPath},1327:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.summary=t.markdownSummary=t.SUMMARY_DOCS_URL=t.SUMMARY_ENV_VAR=void 0;const i=r(2037);const s=r(7147);const{access:o,appendFile:a,writeFile:u}=s.promises;t.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";t.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return n(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const e=process.env[t.SUMMARY_ENV_VAR];if(!e){throw new Error(`Unable to find environment variable for $${t.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield o(e,s.constants.R_OK|s.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}this._filePath=e;return this._filePath}))}wrap(e,t,r={}){const n=Object.entries(r).map((([e,t])=>` ${e}="${t}"`)).join("");if(!t){return`<${e}${n}>`}return`<${e}${n}>${t}`}write(e){return n(this,void 0,void 0,(function*(){const t=!!(e===null||e===void 0?void 0:e.overwrite);const r=yield this.filePath();const n=t?u:a;yield n(r,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return n(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(e,t=false){this._buffer+=e;return t?this.addEOL():this}addEOL(){return this.addRaw(i.EOL)}addCodeBlock(e,t){const r=Object.assign({},t&&{lang:t});const n=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(n).addEOL()}addList(e,t=false){const r=t?"ol":"ul";const n=e.map((e=>this.wrap("li",e))).join("");const i=this.wrap(r,n);return this.addRaw(i).addEOL()}addTable(e){const t=e.map((e=>{const t=e.map((e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:t,data:r,colspan:n,rowspan:i}=e;const s=t?"th":"td";const o=Object.assign(Object.assign({},n&&{colspan:n}),i&&{rowspan:i});return this.wrap(s,r,o)})).join("");return this.wrap("tr",t)})).join("");const r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){const r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){const{width:n,height:i}=r||{};const s=Object.assign(Object.assign({},n&&{width:n}),i&&{height:i});const o=this.wrap("img",null,Object.assign({src:e,alt:t},s));return this.addRaw(o).addEOL()}addHeading(e,t){const r=`h${t}`;const n=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1";const i=this.wrap(n,e);return this.addRaw(i).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const r=Object.assign({},t&&{cite:t});const n=this.wrap("blockquote",e,r);return this.addRaw(n).addEOL()}addLink(e,t){const r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}}const c=new Summary;t.markdownSummary=c;t.summary=c},5278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toCommandProperties=t.toCommandValue=void 0;function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}t.toCommandValue=toCommandValue;function toCommandProperties(e){if(!Object.keys(e).length){return{}}return{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}}t.toCommandProperties=toCommandProperties},1514:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getExecOutput=t.exec=void 0;const a=r(1576);const u=s(r(8159));function exec(e,t,r){return o(this,void 0,void 0,(function*(){const n=u.argStringToArray(e);if(n.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const i=n[0];t=n.slice(1).concat(t||[]);const s=new u.ToolRunner(i,t,r);return s.exec()}))}t.exec=exec;function getExecOutput(e,t,r){var n,i;return o(this,void 0,void 0,(function*(){let s="";let o="";const u=new a.StringDecoder("utf8");const c=new a.StringDecoder("utf8");const d=(n=r===null||r===void 0?void 0:r.listeners)===null||n===void 0?void 0:n.stdout;const l=(i=r===null||r===void 0?void 0:r.listeners)===null||i===void 0?void 0:i.stderr;const stdErrListener=e=>{o+=c.write(e);if(l){l(e)}};const stdOutListener=e=>{s+=u.write(e);if(d){d(e)}};const f=Object.assign(Object.assign({},r===null||r===void 0?void 0:r.listeners),{stdout:stdOutListener,stderr:stdErrListener});const p=yield exec(e,t,Object.assign(Object.assign({},r),{listeners:f}));s+=u.end();o+=c.end();return{exitCode:p,stdout:s,stderr:o}}))}t.getExecOutput=getExecOutput},8159:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.argStringToArray=t.ToolRunner=void 0;const a=s(r(2037));const u=s(r(2361));const c=s(r(2081));const d=s(r(1017));const l=s(r(7351));const f=s(r(1962));const p=r(9512);const h=process.platform==="win32";class ToolRunner extends u.EventEmitter{constructor(e,t,r){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=t||[];this.options=r||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,t){const r=this._getSpawnFileName();const n=this._getSpawnArgs(e);let i=t?"":"[command]";if(h){if(this._isCmdFile()){i+=r;for(const e of n){i+=` ${e}`}}else if(e.windowsVerbatimArguments){i+=`"${r}"`;for(const e of n){i+=` ${e}`}}else{i+=this._windowsQuoteCmdArg(r);for(const e of n){i+=` ${this._windowsQuoteCmdArg(e)}`}}}else{i+=r;for(const e of n){i+=` ${e}`}}return i}_processLineBuffer(e,t,r){try{let n=t+e.toString();let i=n.indexOf(a.EOL);while(i>-1){const e=n.substring(0,i);r(e);n=n.substring(i+a.EOL.length);i=n.indexOf(a.EOL)}return n}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(h){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(h){if(this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const r of this.args){t+=" ";t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r)}t+='"';return[t]}}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let r=false;for(const n of e){if(t.some((e=>e===n))){r=true;break}}if(!r){return e}let n='"';let i=true;for(let t=e.length;t>0;t--){n+=e[t-1];if(i&&e[t-1]==="\\"){n+="\\"}else if(e[t-1]==='"'){i=true;n+='"'}else{i=false}}n+='"';return n.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let t='"';let r=true;for(let n=e.length;n>0;n--){t+=e[n-1];if(r&&e[n-1]==="\\"){t+="\\"}else if(e[n-1]==='"'){r=true;t+="\\"}else{r=false}}t+='"';return t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};t.outStream=e.outStream||process.stdout;t.errStream=e.errStream||process.stderr;return t}_getSpawnOptions(e,t){e=e||{};const r={};r.cwd=e.cwd;r.env=e.env;r["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){r.argv0=`"${t}"`}return r}exec(){return o(this,void 0,void 0,(function*(){if(!f.isRooted(this.toolPath)&&(this.toolPath.includes("/")||h&&this.toolPath.includes("\\"))){this.toolPath=d.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield l.which(this.toolPath,true);return new Promise(((e,t)=>o(this,void 0,void 0,(function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const r=this._cloneExecOptions(this.options);if(!r.silent&&r.outStream){r.outStream.write(this._getCommandString(r)+a.EOL)}const n=new ExecState(r,this.toolPath);n.on("debug",(e=>{this._debug(e)}));if(this.options.cwd&&!(yield f.exists(this.options.cwd))){return t(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const i=this._getSpawnFileName();const s=c.spawn(i,this._getSpawnArgs(r),this._getSpawnOptions(this.options,i));let o="";if(s.stdout){s.stdout.on("data",(e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!r.silent&&r.outStream){r.outStream.write(e)}o=this._processLineBuffer(e,o,(e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}}))}))}let u="";if(s.stderr){s.stderr.on("data",(e=>{n.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!r.silent&&r.errStream&&r.outStream){const t=r.failOnStdErr?r.errStream:r.outStream;t.write(e)}u=this._processLineBuffer(e,u,(e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}}))}))}s.on("error",(e=>{n.processError=e.message;n.processExited=true;n.processClosed=true;n.CheckComplete()}));s.on("exit",(e=>{n.processExitCode=e;n.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);n.CheckComplete()}));s.on("close",(e=>{n.processExitCode=e;n.processExited=true;n.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);n.CheckComplete()}));n.on("done",((r,n)=>{if(o.length>0){this.emit("stdline",o)}if(u.length>0){this.emit("errline",u)}s.removeAllListeners();if(r){t(r)}else{e(n)}}));if(this.options.input){if(!s.stdin){throw new Error("child process missing stdin")}s.stdin.end(this.options.input)}}))))}))}}t.ToolRunner=ToolRunner;function argStringToArray(e){const t=[];let r=false;let n=false;let i="";function append(e){if(n&&e!=='"'){i+="\\"}i+=e;n=false}for(let s=0;s0){t.push(i);i=""}continue}append(o)}if(i.length>0){t.push(i.trim())}return t}t.argStringToArray=argStringToArray;class ExecState extends u.EventEmitter{constructor(e,t){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!t){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=t;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=p.setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}},5526:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.PersonalAccessTokenCredentialHandler=t.BearerCredentialHandler=t.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.HttpClient=t.isHttps=t.HttpClientResponse=t.HttpClientError=t.getProxyUrl=t.MediaTypes=t.Headers=t.HttpCodes=void 0;const a=s(r(3685));const u=s(r(5687));const c=s(r(9835));const d=s(r(4294));var l;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(l=t.HttpCodes||(t.HttpCodes={}));var f;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(f=t.Headers||(t.Headers={}));var p;(function(e){e["ApplicationJson"]="application/json"})(p=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){const t=c.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const h=[l.MovedPermanently,l.ResourceMoved,l.SeeOther,l.TemporaryRedirect,l.PermanentRedirect];const v=[l.BadGateway,l.ServiceUnavailable,l.GatewayTimeout];const m=["OPTIONS","GET","DELETE","HEAD"];const g=10;const w=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}t.HttpClientError=HttpClientError;class HttpClientResponse{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())}))}))))}))}}t.HttpClientResponse=HttpClientResponse;function isHttps(e){const t=new URL(e);return t.protocol==="https:"}t.isHttps=isHttps;class HttpClient{constructor(e,t,r){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=e;this.handlers=t||[];this.requestOptions=r;if(r){if(r.ignoreSslError!=null){this._ignoreSslError=r.ignoreSslError}this._socketTimeout=r.socketTimeout;if(r.allowRedirects!=null){this._allowRedirects=r.allowRedirects}if(r.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=r.allowRedirectDowngrade}if(r.maxRedirects!=null){this._maxRedirects=Math.max(r.maxRedirects,0)}if(r.keepAlive!=null){this._keepAlive=r.keepAlive}if(r.allowRetries!=null){this._allowRetries=r.allowRetries}if(r.maxRetries!=null){this._maxRetries=r.maxRetries}}}options(e,t){return o(this,void 0,void 0,(function*(){return this.request("OPTIONS",e,null,t||{})}))}get(e,t){return o(this,void 0,void 0,(function*(){return this.request("GET",e,null,t||{})}))}del(e,t){return o(this,void 0,void 0,(function*(){return this.request("DELETE",e,null,t||{})}))}post(e,t,r){return o(this,void 0,void 0,(function*(){return this.request("POST",e,t,r||{})}))}patch(e,t,r){return o(this,void 0,void 0,(function*(){return this.request("PATCH",e,t,r||{})}))}put(e,t,r){return o(this,void 0,void 0,(function*(){return this.request("PUT",e,t,r||{})}))}head(e,t){return o(this,void 0,void 0,(function*(){return this.request("HEAD",e,null,t||{})}))}sendStream(e,t,r,n){return o(this,void 0,void 0,(function*(){return this.request(e,t,r,n)}))}getJson(e,t={}){return o(this,void 0,void 0,(function*(){t[f.Accept]=this._getExistingOrDefaultHeader(t,f.Accept,p.ApplicationJson);const r=yield this.get(e,t);return this._processResponse(r,this.requestOptions)}))}postJson(e,t,r={}){return o(this,void 0,void 0,(function*(){const n=JSON.stringify(t,null,2);r[f.Accept]=this._getExistingOrDefaultHeader(r,f.Accept,p.ApplicationJson);r[f.ContentType]=this._getExistingOrDefaultHeader(r,f.ContentType,p.ApplicationJson);const i=yield this.post(e,n,r);return this._processResponse(i,this.requestOptions)}))}putJson(e,t,r={}){return o(this,void 0,void 0,(function*(){const n=JSON.stringify(t,null,2);r[f.Accept]=this._getExistingOrDefaultHeader(r,f.Accept,p.ApplicationJson);r[f.ContentType]=this._getExistingOrDefaultHeader(r,f.ContentType,p.ApplicationJson);const i=yield this.put(e,n,r);return this._processResponse(i,this.requestOptions)}))}patchJson(e,t,r={}){return o(this,void 0,void 0,(function*(){const n=JSON.stringify(t,null,2);r[f.Accept]=this._getExistingOrDefaultHeader(r,f.Accept,p.ApplicationJson);r[f.ContentType]=this._getExistingOrDefaultHeader(r,f.ContentType,p.ApplicationJson);const i=yield this.patch(e,n,r);return this._processResponse(i,this.requestOptions)}))}request(e,t,r,n){return o(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const i=new URL(t);let s=this._prepareRequest(e,i,n);const o=this._allowRetries&&m.includes(e)?this._maxRetries+1:1;let a=0;let u;do{u=yield this.requestRaw(s,r);if(u&&u.message&&u.message.statusCode===l.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(u)){e=t;break}}if(e){return e.handleAuthentication(this,s,r)}else{return u}}let t=this._maxRedirects;while(u.message.statusCode&&h.includes(u.message.statusCode)&&this._allowRedirects&&t>0){const o=u.message.headers["location"];if(!o){break}const a=new URL(o);if(i.protocol==="https:"&&i.protocol!==a.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield u.readBody();if(a.hostname!==i.hostname){for(const e in n){if(e.toLowerCase()==="authorization"){delete n[e]}}}s=this._prepareRequest(e,a,n);u=yield this.requestRaw(s,r);t--}if(!u.message.statusCode||!v.includes(u.message.statusCode)){return u}a+=1;if(a{function callbackForResult(e,t){if(e){n(e)}else if(!t){n(new Error("Unknown error"))}else{r(t)}}this.requestRawWithCallback(e,t,callbackForResult)}))}))}requestRawWithCallback(e,t,r){if(typeof t==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let n=false;function handleResult(e,t){if(!n){n=true;r(e,t)}}const i=e.httpModule.request(e.options,(e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)}));let s;i.on("socket",(e=>{s=e}));i.setTimeout(this._socketTimeout||3*6e4,(()=>{if(s){s.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))}));i.on("error",(function(e){handleResult(e)}));if(t&&typeof t==="string"){i.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",(function(){i.end()}));t.pipe(i)}else{i.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,r){const n={};n.parsedUrl=t;const i=n.parsedUrl.protocol==="https:";n.httpModule=i?u:a;const s=i?443:80;n.options={};n.options.host=n.parsedUrl.hostname;n.options.port=n.parsedUrl.port?parseInt(n.parsedUrl.port):s;n.options.path=(n.parsedUrl.pathname||"")+(n.parsedUrl.search||"");n.options.method=e;n.options.headers=this._mergeHeaders(r);if(this.userAgent!=null){n.options.headers["user-agent"]=this.userAgent}n.options.agent=this._getAgent(n.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(n.options)}}return n}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,r){let n;if(this.requestOptions&&this.requestOptions.headers){n=lowercaseKeys(this.requestOptions.headers)[t]}return e[t]||n||r}_getAgent(e){let t;const r=c.getProxyUrl(e);const n=r&&r.hostname;if(this._keepAlive&&n){t=this._proxyAgent}if(this._keepAlive&&!n){t=this._agent}if(t){return t}const i=e.protocol==="https:";let s=100;if(this.requestOptions){s=this.requestOptions.maxSockets||a.globalAgent.maxSockets}if(r&&r.hostname){const e={maxSockets:s,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})};let n;const o=r.protocol==="https:";if(i){n=o?d.httpsOverHttps:d.httpsOverHttp}else{n=o?d.httpOverHttps:d.httpOverHttp}t=n(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:s};t=i?new u.Agent(e):new a.Agent(e);this._agent=t}if(!t){t=i?u.globalAgent:a.globalAgent}if(i&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){return o(this,void 0,void 0,(function*(){e=Math.min(g,e);const t=w*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),t)))}))}_processResponse(e,t){return o(this,void 0,void 0,(function*(){return new Promise(((r,n)=>o(this,void 0,void 0,(function*(){const i=e.message.statusCode||0;const s={statusCode:i,result:null,headers:{}};if(i===l.NotFound){r(s)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let o;let a;try{a=yield e.readBody();if(a&&a.length>0){if(t&&t.deserializeDates){o=JSON.parse(a,dateTimeDeserializer)}else{o=JSON.parse(a)}s.result=o}s.headers=e.message.headers}catch(e){}if(i>299){let e;if(o&&o.message){e=o.message}else if(a&&a.length>0){e=a}else{e=`Failed request: (${i})`}const t=new HttpClientError(e,i);t.result=s.result;n(t)}else{r(s)}}))))}))}}t.HttpClient=HttpClient;const lowercaseKeys=e=>Object.keys(e).reduce(((t,r)=>(t[r.toLowerCase()]=e[r],t)),{})},9835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.checkBypass=t.getProxyUrl=void 0;function getProxyUrl(e){const t=e.protocol==="https:";if(checkBypass(e)){return undefined}const r=(()=>{if(t){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(r){return new URL(r)}else{return undefined}}t.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}const t=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!t){return false}let r;if(e.port){r=Number(e.port)}else if(e.protocol==="http:"){r=80}else if(e.protocol==="https:"){r=443}const n=[e.hostname.toUpperCase()];if(typeof r==="number"){n.push(`${n[0]}:${r}`)}for(const e of t.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e))){if(n.some((t=>t===e))){return true}}return false}t.checkBypass=checkBypass},1962:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var a;Object.defineProperty(t,"__esModule",{value:true});t.getCmdPath=t.tryGetExecutablePath=t.isRooted=t.isDirectory=t.exists=t.READONLY=t.UV_FS_O_EXLOCK=t.IS_WINDOWS=t.unlink=t.symlink=t.stat=t.rmdir=t.rm=t.rename=t.readlink=t.readdir=t.open=t.mkdir=t.lstat=t.copyFile=t.chmod=void 0;const u=s(r(7147));const c=s(r(1017));a=u.promises,t.chmod=a.chmod,t.copyFile=a.copyFile,t.lstat=a.lstat,t.mkdir=a.mkdir,t.open=a.open,t.readdir=a.readdir,t.readlink=a.readlink,t.rename=a.rename,t.rm=a.rm,t.rmdir=a.rmdir,t.stat=a.stat,t.symlink=a.symlink,t.unlink=a.unlink;t.IS_WINDOWS=process.platform==="win32";t.UV_FS_O_EXLOCK=268435456;t.READONLY=u.constants.O_RDONLY;function exists(e){return o(this,void 0,void 0,(function*(){try{yield t.stat(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true}))}t.exists=exists;function isDirectory(e,r=false){return o(this,void 0,void 0,(function*(){const n=r?yield t.stat(e):yield t.lstat(e);return n.isDirectory()}))}t.isDirectory=isDirectory;function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(t.IS_WINDOWS){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}t.isRooted=isRooted;function tryGetExecutablePath(e,r){return o(this,void 0,void 0,(function*(){let n=undefined;try{n=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(n&&n.isFile()){if(t.IS_WINDOWS){const t=c.extname(e).toUpperCase();if(r.some((e=>e.toUpperCase()===t))){return e}}else{if(isUnixExecutable(n)){return e}}}const i=e;for(const s of r){e=i+s;n=undefined;try{n=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(n&&n.isFile()){if(t.IS_WINDOWS){try{const r=c.dirname(e);const n=c.basename(e).toUpperCase();for(const i of yield t.readdir(r)){if(n===i.toUpperCase()){e=c.join(r,i);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(n)){return e}}}}return""}))}t.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(e){e=e||"";if(t.IS_WINDOWS){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}function getCmdPath(){var e;return(e=process.env["COMSPEC"])!==null&&e!==void 0?e:`cmd.exe`}t.getCmdPath=getCmdPath},7351:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.findInPath=t.which=t.mkdirP=t.rmRF=t.mv=t.cp=void 0;const a=r(9491);const u=s(r(1017));const c=s(r(1962));function cp(e,t,r={}){return o(this,void 0,void 0,(function*(){const{force:n,recursive:i,copySourceDirectory:s}=readCopyOptions(r);const o=(yield c.exists(t))?yield c.stat(t):null;if(o&&o.isFile()&&!n){return}const a=o&&o.isDirectory()&&s?u.join(t,u.basename(e)):t;if(!(yield c.exists(e))){throw new Error(`no such file or directory: ${e}`)}const d=yield c.stat(e);if(d.isDirectory()){if(!i){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,a,0,n)}}else{if(u.relative(e,a)===""){throw new Error(`'${a}' and '${e}' are the same file`)}yield copyFile(e,a,n)}}))}t.cp=cp;function mv(e,t,r={}){return o(this,void 0,void 0,(function*(){if(yield c.exists(t)){let n=true;if(yield c.isDirectory(t)){t=u.join(t,u.basename(e));n=yield c.exists(t)}if(n){if(r.force==null||r.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(u.dirname(t));yield c.rename(e,t)}))}t.mv=mv;function rmRF(e){return o(this,void 0,void 0,(function*(){if(c.IS_WINDOWS){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield c.rm(e,{force:true,maxRetries:3,recursive:true,retryDelay:300})}catch(e){throw new Error(`File was unable to be removed ${e}`)}}))}t.rmRF=rmRF;function mkdirP(e){return o(this,void 0,void 0,(function*(){a.ok(e,"a path argument must be provided");yield c.mkdir(e,{recursive:true})}))}t.mkdirP=mkdirP;function which(e,t){return o(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(c.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return t}const r=yield findInPath(e);if(r&&r.length>0){return r[0]}return""}))}t.which=which;function findInPath(e){return o(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(c.IS_WINDOWS&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(u.delimiter)){if(e){t.push(e)}}}if(c.isRooted(e)){const r=yield c.tryGetExecutablePath(e,t);if(r){return[r]}return[]}if(e.includes(u.sep)){return[]}const r=[];if(process.env.PATH){for(const e of process.env.PATH.split(u.delimiter)){if(e){r.push(e)}}}const n=[];for(const i of r){const r=yield c.tryGetExecutablePath(u.join(i,e),t);if(r){n.push(r)}}return n}))}t.findInPath=findInPath;function readCopyOptions(e){const t=e.force==null?true:e.force;const r=Boolean(e.recursive);const n=e.copySourceDirectory==null?true:Boolean(e.copySourceDirectory);return{force:t,recursive:r,copySourceDirectory:n}}function cpDirRecursive(e,t,r,n){return o(this,void 0,void 0,(function*(){if(r>=255)return;r++;yield mkdirP(t);const i=yield c.readdir(e);for(const s of i){const i=`${e}/${s}`;const o=`${t}/${s}`;const a=yield c.lstat(i);if(a.isDirectory()){yield cpDirRecursive(i,o,r,n)}else{yield copyFile(i,o,n)}}yield c.chmod(t,(yield c.stat(e)).mode)}))}function copyFile(e,t,r){return o(this,void 0,void 0,(function*(){if((yield c.lstat(e)).isSymbolicLink()){try{yield c.lstat(t);yield c.unlink(t)}catch(e){if(e.code==="EPERM"){yield c.chmod(t,"0666");yield c.unlink(t)}}const r=yield c.readlink(e);yield c.symlink(r,t,c.IS_WINDOWS?"junction":null)}else if(!(yield c.exists(t))||r){yield c.copyFile(e,t)}}))}},4773:function(e,t){(function(e,r){true?r(t):0})(this,(function(e){"use strict";const t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;const validateAndParse=e=>{if(typeof e!=="string"){throw new TypeError("Invalid argument expected string")}const r=e.match(t);if(!r){throw new Error(`Invalid argument not valid semver ('${e}' received)`)}r.shift();return r};const isWildcard=e=>e==="*"||e==="x"||e==="X";const tryParse=e=>{const t=parseInt(e,10);return isNaN(t)?e:t};const forceType=(e,t)=>typeof e!==typeof t?[String(e),String(t)]:[e,t];const compareStrings=(e,t)=>{if(isWildcard(e)||isWildcard(t))return 0;const[r,n]=forceType(tryParse(e),tryParse(t));if(r>n)return 1;if(r{for(let r=0;r{const r=validateAndParse(e);const n=validateAndParse(t);const i=r.pop();const s=n.pop();const o=compareSegments(r,n);if(o!==0)return o;if(i&&s){return compareSegments(i.split("."),s.split("."))}else if(i||s){return i?-1:1}return 0};const compare=(e,t,n)=>{assertValidOperator(n);const i=compareVersions(e,t);return r[n].includes(i)};const r={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};const n=Object.keys(r);const assertValidOperator=e=>{if(typeof e!=="string"){throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`)}if(n.indexOf(e)===-1){throw new Error(`Invalid operator, expected one of ${n.join("|")}`)}};const satisfies=(e,t)=>{t=t.replace(/([><=]+)\s+/g,"$1");if(t.includes("||")){return t.split("||").some((t=>satisfies(e,t)))}else if(t.includes(" - ")){const[r,n]=t.split(" - ",2);return satisfies(e,`>=${r} <=${n}`)}else if(t.includes(" ")){return t.trim().replace(/\s{2,}/g," ").split(" ").every((t=>satisfies(e,t)))}const r=t.match(/^([<>=~^]+)/);const n=r?r[1]:"=";if(n!=="^"&&n!=="~")return compare(e,t,n);const[i,s,o,,a]=validateAndParse(e);const[u,c,d,,l]=validateAndParse(t);const f=[i,s,o];const p=[u,c!==null&&c!==void 0?c:"x",d!==null&&d!==void 0?d:"x"];if(l){if(!a)return false;if(compareSegments(f,p)!==0)return false;if(compareSegments(a.split("."),l.split("."))===-1)return false}const h=p.findIndex((e=>e!=="0"))+1;const v=n==="~"?2:h>1?h:1;if(compareSegments(f.slice(0,v),p.slice(0,v))!==0)return false;if(compareSegments(f.slice(v),p.slice(v))===-1)return false;return true};const validate=e=>typeof e==="string"&&/^[v\d]/.test(e)&&t.test(e);const validateStrict=e=>typeof e==="string"&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(e);e.compare=compare;e.compareVersions=compareVersions;e.satisfies=satisfies;e.validate=validate;e.validateStrict=validateStrict}))},4294:(e,t,r)=>{e.exports=r(4219)},4219:(e,t,r)=>{"use strict";var n=r(1808);var i=r(4404);var s=r(3685);var o=r(5687);var a=r(2361);var u=r(9491);var c=r(3837);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=s.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=s.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=o.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=o.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||s.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",(function onFree(e,r,n,i){var s=toOptions(r,n,i);for(var o=0,a=t.requests.length;o=this.maxSockets){i.requests.push(s);return}i.createSocket(s,(function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){i.emit("free",t,s)}function onCloseOrRemove(e){i.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var r=this;var n={};r.sockets.push(n);var i=mergeOptions({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){i.localAddress=e.localAddress}if(i.proxyAuth){i.headers=i.headers||{};i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")}d("making CONNECT request");var s=r.request(i);s.useChunkedEncodingByDefault=false;s.once("response",onResponse);s.once("upgrade",onUpgrade);s.once("connect",onConnect);s.once("error",onError);s.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,r){process.nextTick((function(){onConnect(e,t,r)}))}function onConnect(i,o,a){s.removeAllListeners();o.removeAllListeners();if(i.statusCode!==200){d("tunneling socket could not be established, statusCode=%d",i.statusCode);o.destroy();var u=new Error("tunneling socket could not be established, "+"statusCode="+i.statusCode);u.code="ECONNRESET";e.request.emit("error",u);r.removeSocket(n);return}if(a.length>0){d("got illegal response body from proxy");o.destroy();var u=new Error("got illegal response body from proxy");u.code="ECONNRESET";e.request.emit("error",u);r.removeSocket(n);return}d("tunneling connection has established");r.sockets[r.sockets.indexOf(n)]=o;return t(o)}function onError(t){s.removeAllListeners();d("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, "+"cause="+t.message);i.code="ECONNRESET";e.request.emit("error",i);r.removeSocket(n)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var r=this.requests.shift();if(r){this.createSocket(r,(function(e){r.request.onSocket(e)}))}};function createSecureSocket(e,t){var r=this;TunnelingAgent.prototype.createSocket.call(r,e,(function(n){var s=e.request.getHeader("host");var o=mergeOptions({},r.options,{socket:n,servername:s?s.replace(/:.*$/,""):e.host});var a=i.connect(0,o);r.sockets[r.sockets.indexOf(n)]=a;t(a)}))}function toOptions(e,t,r){if(typeof e==="string"){return{host:e,port:t,localAddress:r}}return e}function mergeOptions(e){for(var t=1,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"v1",{enumerable:true,get:function(){return n.default}});Object.defineProperty(t,"v3",{enumerable:true,get:function(){return i.default}});Object.defineProperty(t,"v4",{enumerable:true,get:function(){return s.default}});Object.defineProperty(t,"v5",{enumerable:true,get:function(){return o.default}});Object.defineProperty(t,"NIL",{enumerable:true,get:function(){return a.default}});Object.defineProperty(t,"version",{enumerable:true,get:function(){return u.default}});Object.defineProperty(t,"validate",{enumerable:true,get:function(){return c.default}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return d.default}});Object.defineProperty(t,"parse",{enumerable:true,get:function(){return l.default}});var n=_interopRequireDefault(r(8628));var i=_interopRequireDefault(r(6409));var s=_interopRequireDefault(r(5122));var o=_interopRequireDefault(r(9120));var a=_interopRequireDefault(r(5332));var u=_interopRequireDefault(r(1595));var c=_interopRequireDefault(r(6900));var d=_interopRequireDefault(r(8950));var l=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},4569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function md5(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return n.default.createHash("md5").update(e).digest()}var i=md5;t["default"]=i},5332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r="00000000-0000-0000-0000-000000000000";t["default"]=r},2746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e){if(!(0,n.default)(e)){throw TypeError("Invalid UUID")}let t;const r=new Uint8Array(16);r[0]=(t=parseInt(e.slice(0,8),16))>>>24;r[1]=t>>>16&255;r[2]=t>>>8&255;r[3]=t&255;r[4]=(t=parseInt(e.slice(9,13),16))>>>8;r[5]=t&255;r[6]=(t=parseInt(e.slice(14,18),16))>>>8;r[7]=t&255;r[8]=(t=parseInt(e.slice(19,23),16))>>>8;r[9]=t&255;r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255;r[11]=t/4294967296&255;r[12]=t>>>24&255;r[13]=t>>>16&255;r[14]=t>>>8&255;r[15]=t&255;return r}var i=parse;t["default"]=i},814:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;t["default"]=r},807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=rng;var n=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const i=new Uint8Array(256);let s=i.length;function rng(){if(s>i.length-16){n.default.randomFillSync(i);s=0}return i.slice(s,s+=16)}},5274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function sha1(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return n.default.createHash("sha1").update(e).digest()}var i=sha1;t["default"]=i},8950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const i=[];for(let e=0;e<256;++e){i.push((e+256).toString(16).substr(1))}function stringify(e,t=0){const r=(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase();if(!(0,n.default)(r)){throw TypeError("Stringified UUID is invalid")}return r}var s=stringify;t["default"]=s},8628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(807));var i=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let s;let o;let a=0;let u=0;function v1(e,t,r){let c=t&&r||0;const d=t||new Array(16);e=e||{};let l=e.node||s;let f=e.clockseq!==undefined?e.clockseq:o;if(l==null||f==null){const t=e.random||(e.rng||n.default)();if(l==null){l=s=[t[0]|1,t[1],t[2],t[3],t[4],t[5]]}if(f==null){f=o=(t[6]<<8|t[7])&16383}}let p=e.msecs!==undefined?e.msecs:Date.now();let h=e.nsecs!==undefined?e.nsecs:u+1;const v=p-a+(h-u)/1e4;if(v<0&&e.clockseq===undefined){f=f+1&16383}if((v<0||p>a)&&e.nsecs===undefined){h=0}if(h>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}a=p;u=h;o=f;p+=122192928e5;const m=((p&268435455)*1e4+h)%4294967296;d[c++]=m>>>24&255;d[c++]=m>>>16&255;d[c++]=m>>>8&255;d[c++]=m&255;const g=p/4294967296*1e4&268435455;d[c++]=g>>>8&255;d[c++]=g&255;d[c++]=g>>>24&15|16;d[c++]=g>>>16&255;d[c++]=f>>>8|128;d[c++]=f&255;for(let e=0;e<6;++e){d[c+e]=l[e]}return t||(0,i.default)(d)}var c=v1;t["default"]=c},6409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(5998));var i=_interopRequireDefault(r(4569));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const s=(0,n.default)("v3",48,i.default);var o=s;t["default"]=o},5998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=_default;t.URL=t.DNS=void 0;var n=_interopRequireDefault(r(8950));var i=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringToBytes(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(807));var i=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function v4(e,t,r){e=e||{};const s=e.random||(e.rng||n.default)();s[6]=s[6]&15|64;s[8]=s[8]&63|128;if(t){r=r||0;for(let e=0;e<16;++e){t[r+e]=s[e]}return t}return(0,i.default)(s)}var s=v4;t["default"]=s},9120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(5998));var i=_interopRequireDefault(r(5274));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const s=(0,n.default)("v5",80,i.default);var o=s;t["default"]=o},6900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(814));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function validate(e){return typeof e==="string"&&n.default.test(e)}var i=validate;t["default"]=i},1595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function version(e){if(!(0,n.default)(e)){throw TypeError("Invalid UUID")}return parseInt(e.substr(14,1),16)}var i=version;t["default"]=i},9491:e=>{"use strict";e.exports=require("assert")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},1576:e=>{"use strict";e.exports=require("string_decoder")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var s=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(9039);module.exports=r})(); \ No newline at end of file diff --git a/src/config.ts b/src/config.ts index 07f897663..bd6e008c0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -17,7 +17,7 @@ export async function addINIValuesUnix( return ( 'echo "' + ini_values.join('\n') + - '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' + + '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" ' + script ); } diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index d4ef3f52c..a6cc998b5 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -13,9 +13,9 @@ handle_dependency_extensions() { suffix="$(get_php_formula_suffix)" if [[ -n "$suffix" ]]; then brew_opts=(-sf) - patch_abstract_file >/dev/null 2>&1 + patch_abstract_file for dependency_extension in "${dependency_extensions[@]}"; do - brew install "${brew_opts[@]}" "$ext_tap/$dependency_extension@$version" >/dev/null 2>&1 && copy_brew_extensions "$dependency_extension" + brew install "${brew_opts[@]}" "$ext_tap/$dependency_extension@$version" && copy_brew_extensions "$dependency_extension" done fi } @@ -31,7 +31,7 @@ disable_extension_helper() { sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}" sudo rm -rf "$scan_dir"/*"$extension"* /tmp/php"$version"_extensions mkdir -p /tmp/extdisabled/"$version" - echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1 + echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" } # Function to get extension name from brew formula. @@ -70,9 +70,9 @@ add_brew_extension() { add_brew_tap "$php_tap" add_brew_tap "$ext_tap" sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "${core_repo:?}/Formula/" 2>/dev/null || true - update_dependencies >/dev/null 2>&1 - handle_dependency_extensions "$formula" "$extension" >/dev/null 2>&1 - (brew install "${brew_opts[@]}" "$ext_tap/$formula@$version" >/dev/null 2>&1 && copy_brew_extensions "$formula") || pecl_install "$extension" >/dev/null 2>&1 + update_dependencies + handle_dependency_extensions "$formula" "$extension" + (brew install "${brew_opts[@]}" "$ext_tap/$formula@$version" && copy_brew_extensions "$formula") || pecl_install "$extension" add_extension_log "$extension" "Installed and enabled" fi } @@ -81,7 +81,7 @@ add_brew_extension() { patch_abstract_file() { abstract_path="$tap_dir"/"$ext_tap"/Abstract/abstract-php-extension.rb if [[ -e "$abstract_path" && ! -e /tmp/abstract_patch ]]; then - echo '' | sudo tee /tmp/abstract_patch >/dev/null 2>&1 + echo '' | sudo tee /tmp/abstract_patch sudo sed -i '' -e "s|php@#{\(.*\)}|php@#{\1}$suffix|g" -e "s|php_version /|\"#{php_version}$suffix\" /|g" "$abstract_path" fi } @@ -91,9 +91,9 @@ add_extension_helper() { local extension=$1 prefix=$2 if [[ "$version" =~ ${old_versions:?} ]] && [ "$extension" = "imagick" ]; then - run_script "php5-darwin" "${version/./}" "$extension" >/dev/null 2>&1 + run_script "php5-darwin" "${version/./}" "$extension" else - pecl_install "$extension" >/dev/null 2>&1 && + pecl_install "$extension" && if [[ "$version" =~ ${old_versions:?} ]]; then echo "$prefix=$ext_dir/$extension.so" >>"$ini_file"; fi fi add_extension_log "$extension" "Installed and enabled" @@ -107,8 +107,8 @@ add_devtools() { # Function to handle request to add PECL. add_pecl() { - enable_extension xml extension >/dev/null 2>&1 - configure_pecl >/dev/null 2>&1 + enable_extension xml extension + configure_pecl pear_version=$(get_tool_version "pecl" "version") add_log "${tick:?}" "PECL" "Found PECL $pear_version" } @@ -138,7 +138,7 @@ update_dependencies() { for repo in "$brew_repo" "$core_repo"; do git_retry -C "$repo" fetch origin master && git -C "$repo" reset --hard origin/master done - echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1 + echo '' | sudo tee /tmp/update_dependencies fi } @@ -196,7 +196,7 @@ add_php_config() { if [[ "$ini" = "production" || "$ini" = "development" ]]; then sudo cp "$ini_dir"/php.ini-"$ini" "$ini_dir"/php.ini elif [ "$ini" = "none" ]; then - echo '' | sudo tee "${ini_file[@]}" >/dev/null 2>&1 + echo '' | sudo tee "${ini_file[@]}" fi } @@ -215,16 +215,16 @@ setup_php() { php_config="$(command -v php-config 2>/dev/null)" existing_version=$(get_brewed_php) if [[ "$version" =~ ${old_versions:?} ]]; then - run_script "php5-darwin" "${version/./}" >/dev/null 2>&1 + run_script "php5-darwin" "${version/./}" status="Installed" elif [ "$existing_version" != "$version" ]; then - add_php "install" "$existing_version" >/dev/null 2>&1 + add_php "install" "$existing_version" status="Installed" elif [ "$existing_version" = "$version" ] && [ "${update:?}" = "true" ]; then - add_php "upgrade" "$existing_version" >/dev/null 2>&1 + add_php "upgrade" "$existing_version" status="Updated to" else - add_php "upgrade" "$existing_version" >/dev/null 2>&1 + add_php "upgrade" "$existing_version" status="Updated to" fi php_config="$(command -v php-config)" diff --git a/src/scripts/extensions/add_extensions.sh b/src/scripts/extensions/add_extensions.sh index d07b959f9..b7cb946d4 100644 --- a/src/scripts/extensions/add_extensions.sh +++ b/src/scripts/extensions/add_extensions.sh @@ -48,7 +48,7 @@ enable_extension() { [ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete enable_extension_dependencies "$1" "$2" enable_cache_extension_dependencies "$1" "$2" - if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod >/dev/null 2>&1; then + if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod ; then sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?\"?$/d" "$pecl_file" mod="${ini_dir:?}"/../mods-available/"$1".ini if ! [ -e "$mod" ]; then @@ -57,7 +57,7 @@ enable_extension() { [ -n "$mod_priority_line" ] && priority=$(echo "$mod_priority_line" | cut -d'=' -f 2) (echo "; priority=$priority"; echo "$2=${ext_dir:?}/$1.so") | sudo tee "$mod" >/dev/null fi - sudo phpenmod -v "$version" "$1" >/dev/null 2>&1 + sudo phpenmod -v "$version" "$1" else echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null fi @@ -69,7 +69,7 @@ enable_extensions() { local extensions=("$@") to_wait=() for ext in "${extensions[@]}"; do - enable_extension "$ext" extension >/dev/null 2>&1 & + enable_extension "$ext" extension & to_wait+=($!) done wait "${to_wait[@]}" @@ -77,7 +77,7 @@ enable_extensions() { # Function to get a map of extensions and their dependent shared extensions. get_extension_map() { - php -d'error_reporting=0' "${src:?}"/scripts/extensions/extension_map.php /tmp/map"$version".orig >/dev/null 2>&1 + php -d'error_reporting=0' "${src:?}"/scripts/extensions/extension_map.php /tmp/map"$version".orig } # Function to enable extension dependencies which are also extensions. @@ -123,7 +123,7 @@ disable_extension() { disable_all_shared() { get_extension_map sudo sed -i.orig -E -e "/^(zend_)?extension\s*=/d" "${ini_file[@]}" "$pecl_file" 2>/dev/null || true - sudo find "${ini_dir:-$scan_dir}"/.. -name "*.ini" -not -path "*php.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true + sudo find "${ini_dir:-$scan_dir}"/.. -name "*.ini" -not -path "*php.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete || true mkdir -p /tmp/extdisabled/"$version" sudo rm -f /tmp/php"$version"_extensions sudo find "$ext_dir" -name '*.so' -print0 | xargs -0 -n 1 basename -s .so | xargs -I{} touch /tmp/extdisabled/"$version"/{} @@ -137,7 +137,7 @@ configure_pecl() { for script in pear pecl; do sudo "$script" channel-update "$script".php.net done - echo '' | sudo tee /tmp/pecl_config >/dev/null 2>&1 + echo '' | sudo tee /tmp/pecl_config fi } @@ -175,8 +175,8 @@ get_pecl_version() { pecl_install() { local extension=$1 local prefix=${2:-extension} - add_pecl >/dev/null 2>&1 - disable_extension_helper "${extension%-*}" >/dev/null 2>&1 + add_pecl + disable_extension_helper "${extension%-*}" # Compare version with 8.3 so it runs only on 8.4 and above # Install using the source interface as it allows for patching. if [[ $(printf "%s\n%s" "${version:?}" "8.3" | sort -V | head -n1) != "$version" ]]; then @@ -189,11 +189,11 @@ pecl_install() { prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS) MAKEFLAGS='-j $cpu_count'" suffix_opts="$(parse_args "$extension" CONFIGURE_OPTS) $(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)" IFS=' ' read -r -a libraries <<<"$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)" - (( ${#libraries[@]} )) && add_libs "${libraries[@]}" >/dev/null 2>&1 + (( ${#libraries[@]} )) && add_libs "${libraries[@]}" if [ "$version" = "5.3" ]; then - yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f "$extension" >/dev/null 2>&1 + yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f "$extension" else - yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" >/dev/null 2>&1 + yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" fi local exit_code=$? sudo pecl info "$extension" | grep -iq 'zend extension' && prefix=zend_extension @@ -216,7 +216,7 @@ add_pecl_extension() { add_log "${tick:?}" "$extension" "Enabled" else [ -n "$pecl_version" ] && pecl_version="-$pecl_version" - pecl_install "$extension$pecl_version" || add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1 + pecl_install "$extension$pecl_version" || add_extension "$extension" "$(get_extension_prefix "$extension")" extension_version="$(php -r "echo phpversion('$extension');")" [ -n "$extension_version" ] && extension_version="-$extension_version" add_extension_log "$extension$extension_version" "Installed and enabled" diff --git a/src/scripts/extensions/blackfire.sh b/src/scripts/extensions/blackfire.sh index e06fa3a1b..79b5ae759 100644 --- a/src/scripts/extensions/blackfire.sh +++ b/src/scripts/extensions/blackfire.sh @@ -19,11 +19,11 @@ add_blackfire() { extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3) fi fi - get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_"$arch_name"-php-"$no_dot_version".so >/dev/null 2>&1 + get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_"$arch_name"-php-"$no_dot_version".so fi if [ -e "${ext_dir:?}/blackfire.so" ]; then - disable_extension xdebug >/dev/null 2>&1 - disable_extension pcov >/dev/null 2>&1 + disable_extension xdebug + disable_extension pcov enable_extension blackfire extension add_extension_log blackfire "$status" else diff --git a/src/scripts/extensions/couchbase.sh b/src/scripts/extensions/couchbase.sh index 5ca9f36ba..e00b19d07 100644 --- a/src/scripts/extensions/couchbase.sh +++ b/src/scripts/extensions/couchbase.sh @@ -59,9 +59,9 @@ add_couchbase() { ext=$(get_couchbase_version) fi if [[ "$ext" =~ couchbase-[2-3].+ ]]; then - add_couchbase_clibs "$ext" >/dev/null 2>&1 + add_couchbase_clibs "$ext" else - add_couchbase_cxxlibs >/dev/null 2>&1 + add_couchbase_cxxlibs fi enable_extension "couchbase" "extension" if check_extension "couchbase"; then @@ -72,9 +72,9 @@ add_couchbase() { n_proc="$(nproc)" export COUCHBASE_SUFFIX_OPTS="CMAKE_BUILD_TYPE=Release" export CMAKE_BUILD_PARALLEL_LEVEL="$n_proc" - add_extension_from_source couchbase https://pecl.php.net couchbase couchbase "${ext##*-}" extension pecl >/dev/null 2>&1 + add_extension_from_source couchbase https://pecl.php.net couchbase couchbase "${ext##*-}" extension pecl else - pecl_install "${ext}" >/dev/null 2>&1 + pecl_install "${ext}" fi add_extension_log "couchbase" "Installed and enabled" fi diff --git a/src/scripts/extensions/cubrid.sh b/src/scripts/extensions/cubrid.sh index 201a667c4..b668ef254 100644 --- a/src/scripts/extensions/cubrid.sh +++ b/src/scripts/extensions/cubrid.sh @@ -51,7 +51,7 @@ add_cubrid_helper() { add_cubrid() { ext=$1 status='Enabled' - add_cubrid_helper "$ext" >/dev/null 2>&1 + add_cubrid_helper "$ext" add_extension_log "$ext" "$status" check_extension "$ext" && add_license_log } diff --git a/src/scripts/extensions/event.sh b/src/scripts/extensions/event.sh index 71820b2f8..c2eeaf8e7 100644 --- a/src/scripts/extensions/event.sh +++ b/src/scripts/extensions/event.sh @@ -39,9 +39,9 @@ add_event() { add_log "${tick:?}" "event" "Enabled" else if ! [[ "${version:?}" =~ ${old_versions:?} ]] && [ "$os" = "Darwin" ]; then - add_brew_extension event extension >/dev/null 2>&1 + add_brew_extension event extension else - add_event_helper "$ext" >/dev/null 2>&1 + add_event_helper "$ext" fi add_extension_log "event" "Installed and enabled" fi diff --git a/src/scripts/extensions/firebird.sh b/src/scripts/extensions/firebird.sh index 3c391e954..7f1273526 100644 --- a/src/scripts/extensions/firebird.sh +++ b/src/scripts/extensions/firebird.sh @@ -23,7 +23,7 @@ add_firebird_helper() { add_firebird() { if [ "$(uname -s )" = "Darwin" ]; then - add_firebird_client_darwin >/dev/null 2>&1 + add_firebird_client_darwin fi enable_extension pdo_firebird extension status="Enabled" @@ -31,12 +31,12 @@ add_firebird() { status="Installed and enabled" if [ "$(uname -s)" = "Linux" ]; then if [[ "${version:?}" =~ 5.3|${nightly_versions:?} ]]; then - add_firebird_helper /usr >/dev/null 2>&1 + add_firebird_helper /usr else - add_pdo_extension firebird >/dev/null 2>&1 + add_pdo_extension firebird fi else - add_firebird_helper /opt/firebird >/dev/null 2>&1 + add_firebird_helper /opt/firebird fi fi add_extension_log pdo_firebird "$status" diff --git a/src/scripts/extensions/gearman.sh b/src/scripts/extensions/gearman.sh index eb732dcfe..1bc19ea8c 100644 --- a/src/scripts/extensions/gearman.sh +++ b/src/scripts/extensions/gearman.sh @@ -18,7 +18,7 @@ add_gearman_helper() { add_gearman() { status="Enabled" if [ "$(uname -s)" = 'Linux' ]; then - add_gearman_helper >/dev/null 2>&1 + add_gearman_helper add_extension_log "gearman" "$status" else add_brew_extension gearman extension diff --git a/src/scripts/extensions/geos.sh b/src/scripts/extensions/geos.sh index c685f8664..5825556ac 100644 --- a/src/scripts/extensions/geos.sh +++ b/src/scripts/extensions/geos.sh @@ -11,7 +11,7 @@ add_geos() { if check_extension "geos"; then add_log "${tick:?}" "geos" "Enabled" else - add_geos_helper >/dev/null 2>&1 + add_geos_helper add_extension_log "geos" "Installed and enabled" fi } diff --git a/src/scripts/extensions/http.ps1 b/src/scripts/extensions/http.ps1 index 16d9da3a3..9709c5586 100644 --- a/src/scripts/extensions/http.ps1 +++ b/src/scripts/extensions/http.ps1 @@ -40,12 +40,12 @@ Function Repair-ICU() { } Function Add-Http() { - Add-Extension iconv >$null 2>&1 - Add-Extension raphf >$null 2>&1 + Add-Extension iconv + Add-Extension raphf if($version -lt '8.0') { - Add-Extension propro >$null 2>&1 + Add-Extension propro } - Add-Extension pecl_http >$null 2>&1 + Add-Extension pecl_http Repair-ICU Add-ExtensionLog http "Installed and enabled" } \ No newline at end of file diff --git a/src/scripts/extensions/http.sh b/src/scripts/extensions/http.sh index 6880298e2..0d4d0f28b 100644 --- a/src/scripts/extensions/http.sh +++ b/src/scripts/extensions/http.sh @@ -75,7 +75,7 @@ add_http_latest() { if [ "$os" = "Linux" ]; then add_http_dependencies package="php$version-http" - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php (check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os" else if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then @@ -103,9 +103,9 @@ add_http() { ext=$1 status="Enabled" if [[ "$ext" =~ ^(pecl_http|http)$ ]]; then - add_http_latest >/dev/null 2>&1 + add_http_latest else - add_http_version "$ext" >/dev/null 2>&1 + add_http_version "$ext" fi add_extension_log "http" "$status" } diff --git a/src/scripts/extensions/intl.sh b/src/scripts/extensions/intl.sh index a1ba481d3..8b3d0a48f 100644 --- a/src/scripts/extensions/intl.sh +++ b/src/scripts/extensions/intl.sh @@ -16,7 +16,7 @@ add_intl() { add_log "${cross:?}" "intl" "ICU $icu is not supported" else [ "${ts:?}" = 'zts' ] && suffix='-zts' - install_icu "$icu" >/dev/null 2>&1 + install_icu "$icu" get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix.so" enable_extension intl extension add_extension_log intl "Installed and enabled with ICU $icu" diff --git a/src/scripts/extensions/ioncube.sh b/src/scripts/extensions/ioncube.sh index eca3af756..2ec61dcf2 100644 --- a/src/scripts/extensions/ioncube.sh +++ b/src/scripts/extensions/ioncube.sh @@ -24,10 +24,10 @@ add_ioncube() { if [ -e "$loader_file" ]; then sudo mv /tmp/ioncube/ioncube_loader_"${os_suffix%%_*}_${version:?}$ts_part".so "${ext_dir:?}/ioncube.so" sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt - echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1 + echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" fi else - echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1 + echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" fi add_extension_log "ioncube" "$status" check_extension "ioncube" && add_license_log diff --git a/src/scripts/extensions/oci.sh b/src/scripts/extensions/oci.sh index d68895f51..5de8832a0 100644 --- a/src/scripts/extensions/oci.sh +++ b/src/scripts/extensions/oci.sh @@ -63,8 +63,8 @@ add_oci() { oracle_home='/opt/oracle' oracle_client=$oracle_home/instantclient os=$(uname -s) - add_client >/dev/null 2>&1 - add_oci_helper >/dev/null 2>&1 + add_client + add_oci_helper add_extension_log "$ext" "$status" check_extension "$ext" && add_license_log } diff --git a/src/scripts/extensions/phalcon.sh b/src/scripts/extensions/phalcon.sh index 97a70d9c9..3036473ef 100644 --- a/src/scripts/extensions/phalcon.sh +++ b/src/scripts/extensions/phalcon.sh @@ -34,7 +34,7 @@ add_phalcon_helper() { add_brew_extension "$extension" extension else package="php${version:?}-$extension" - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php [[ "$extension" =~ phalcon[4|5] ]] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0) (check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo fi @@ -94,7 +94,7 @@ add_phalcon() { [ "$extension" = "phalcon" ] && extension=phalcon5 extension_major_version=${extension: -1} if [[ "$extension_major_version" =~ [3-5] ]]; then - add_phalcon"$extension_major_version" >/dev/null 2>&1 + add_phalcon"$extension_major_version" fi add_extension_log "phalcon" "$status" } diff --git a/src/scripts/extensions/relay.sh b/src/scripts/extensions/relay.sh index e62ce01fe..51b5c40af 100644 --- a/src/scripts/extensions/relay.sh +++ b/src/scripts/extensions/relay.sh @@ -138,13 +138,13 @@ add_relay() { relay_releases=https://github.com/cachewerk/relay/releases relay_trunk=https://builds.r2.relay.so relay_version=$(get_relay_version "$ext") - add_relay_dependencies >/dev/null 2>&1 + add_relay_dependencies if shared_extension relay; then message="Enabled" else - add_relay_helper >/dev/null 2>&1 + add_relay_helper message="Installed and enabled" fi - configure_relay >/dev/null 2>&1 + configure_relay add_extension_log relay "$message" } diff --git a/src/scripts/extensions/source.sh b/src/scripts/extensions/source.sh index d5c57a2cd..830e5acdb 100644 --- a/src/scripts/extensions/source.sh +++ b/src/scripts/extensions/source.sh @@ -47,7 +47,7 @@ check_lib() { add_linux_libs() { local lib=$1 if ! check_lib "$lib"; then - install_packages "$lib" >/dev/null 2>&1 || true + install_packages "$lib" || true fi add_lib_log "$lib" } @@ -56,9 +56,9 @@ add_linux_libs() { add_darwin_libs() { local lib=$1 if ! check_lib "$lib"; then - brew install "$lib" >/dev/null 2>&1 || true + brew install "$lib" || true if [[ "$lib" = *@* ]]; then - brew link --overwrite --force "$lib" >/dev/null 2>&1 || true + brew link --overwrite --force "$lib" || true fi fi add_lib_log "$lib" @@ -80,7 +80,7 @@ add_libs() { run_group() { local command=$1 local log=$2 - echo "$command" | sudo tee ./run_group.sh >/dev/null 2>&1 + echo "$command" | sudo tee ./run_group.sh echo "$GROUP$log" . ./run_group.sh rm ./run_group.sh @@ -141,7 +141,7 @@ add_extension_from_source() { sub_dir="$(parse_args "$extension" PATH)" step_log "Setup $slug" ( - add_devtools phpize >/dev/null 2>&1 + add_devtools phpize disable_extension_helper "$extension" fetch_extension "$extension" "$fetch" if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then @@ -149,7 +149,7 @@ add_extension_from_source() { else [[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries" [ "${debug:?}" = "debug" ] && suffix_opts="$suffix_opts --enable-debug" - patch_extension "$extension" >/dev/null 2>&1 + patch_extension "$extension" run_group "phpize" "phpize" run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure" run_group "sudo make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make" diff --git a/src/scripts/extensions/sqlsrv.ps1 b/src/scripts/extensions/sqlsrv.ps1 index 28f8f2aa0..d6d1117cd 100644 --- a/src/scripts/extensions/sqlsrv.ps1 +++ b/src/scripts/extensions/sqlsrv.ps1 @@ -67,10 +67,10 @@ Function Add-Sqlsrv() { Add-ExtensionFromGithub $extension > $null 2>&1 } catch {} if (-not(Test-Extension $extension)) { - Add-SqlsrvFromMSGithub $extension >$null 2>&1 + Add-SqlsrvFromMSGithub $extension } if (-not(Test-Extension $extension)) { - Add-Extension $extension >$null 2>&1 + Add-Extension $extension } $status = 'Installed and enabled' } diff --git a/src/scripts/extensions/zephir_parser.sh b/src/scripts/extensions/zephir_parser.sh index f1c9b5d3a..dfdd59c59 100644 --- a/src/scripts/extensions/zephir_parser.sh +++ b/src/scripts/extensions/zephir_parser.sh @@ -29,7 +29,7 @@ add_zephir_parser() { zp_releases=https://github.com/"$repo"/releases if ! shared_extension zephir_parser; then message='Installed and enabled' - add_zephir_parser_helper "$ext" >/dev/null 2>&1 + add_zephir_parser_helper "$ext" else message='Enabled' enable_extension zephir_parser extension diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 43c9ca1ed..a98da4633 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -25,17 +25,17 @@ self_hosted_helper() { # Function to fix broken packages. fix_broken_packages() { - sudo apt --fix-broken install >/dev/null 2>&1 + sudo apt --fix-broken install } # Function to install a package install_packages() { packages=("$@") if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then - echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1 + echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit fi - $apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1) + $apt_install "${packages[@]}" || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" ) } # Function to disable an extension. @@ -47,10 +47,10 @@ disable_extension_helper() { disable_extension_dependents "$extension" fi sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?\"?$/d" "${ini_file[@]}" "$pecl_file" - sudo find "$ini_dir"/.. -name "*-$extension.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true + sudo find "$ini_dir"/.. -name "*-$extension.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete || true sudo rm -f /tmp/php"$version"_extensions mkdir -p /tmp/extdisabled/"$version" - echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1 + echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" } # Function to add PDO extension. @@ -63,7 +63,7 @@ add_pdo_extension() { ext_name=$1 if shared_extension pdo; then disable_extension_helper pdo - echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1 + echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" fi if [ "$ext" = "mysql" ]; then enable_extension "mysqlnd" "extension" @@ -71,15 +71,15 @@ add_pdo_extension() { elif [ "$ext" = "dblib" ]; then ext_name="sybase" elif [ "$ext" = "firebird" ]; then - install_packages libfbclient2 >/dev/null 2>&1 + install_packages libfbclient2 enable_extension "pdo_firebird" "extension" ext_name="interbase" elif [ "$ext" = "sqlite" ]; then ext="sqlite3" ext_name="sqlite3" fi - add_extension "$ext_name" "extension" >/dev/null 2>&1 - add_extension "$pdo_ext" "extension" >/dev/null 2>&1 + add_extension "$ext_name" "extension" + add_extension "$pdo_ext" "extension" add_extension_log "$pdo_ext" "Enabled" fi } @@ -93,7 +93,7 @@ check_package() { add_extension_helper() { local extension=$1 packages=(php"$version"-"$extension") - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php [ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym) (check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension" add_extension_log "$extension" "Installed and enabled" @@ -107,7 +107,7 @@ add_devtools() { install_packages "php$version-dev" fi switch_version "phpize" "php-config" - add_extension xml extension >/dev/null 2>&1 + add_extension xml extension add_log "${tick:?}" "$tool" "Added $tool $semver" } @@ -128,11 +128,11 @@ setup_cached_versions() { # Function to add PECL. add_pecl() { - add_devtools phpize >/dev/null 2>&1 + add_devtools phpize if ! command -v pecl >/dev/null; then install_packages php-pear fi - configure_pecl >/dev/null 2>&1 + configure_pecl pear_version=$(get_tool_version "pecl" "version") add_log "${tick:?}" "PECL" "Added PECL $pear_version" } @@ -166,7 +166,7 @@ get_php_packages() { # Function to install packaged PHP add_packaged_php() { - add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php + add_ppa ondrej/php || update_ppa ondrej/php IFS=' ' read -r -a packages <<<"$(get_php_packages)" install_packages "${packages[@]}" } @@ -190,7 +190,7 @@ add_php() { setup_nightly else add_packaged_php - switch_version >/dev/null 2>&1 + switch_version add_pecl fi elif [[ "$version" =~ ${old_versions:?} ]]; then @@ -203,7 +203,7 @@ add_php() { # Function to ini file for pear and link it to each SAPI. link_pecl_file() { - echo '' | sudo tee "$pecl_file" >/dev/null 2>&1 + echo '' | sudo tee "$pecl_file" for file in "${ini_file[@]}"; do sapi_scan_dir="$(realpath -m "$(dirname "$file")")/conf.d" if [ "$sapi_scan_dir" != "$scan_dir" ] && ! [ -h "$sapi_scan_dir" ]; then @@ -236,9 +236,9 @@ add_php_config() { elif [ "$ini" = "development" ]; then echo "${ini_file[@]}" | xargs -n 1 -P 6 sudo cp "$php_lib_dir"/php.ini-development elif [ "$ini" = "none" ]; then - echo '' | sudo tee "${ini_file[@]}" >/dev/null 2>&1 + echo '' | sudo tee "${ini_file[@]}" fi - echo "$ini" | sudo tee "$current_ini" >/dev/null 2>&1 + echo "$ini" | sudo tee "$current_ini" } # Function to Setup PHP @@ -248,13 +248,13 @@ setup_php() { php_config="$(command -v php-config)" if [[ -z "$php_config" ]] || [ "$(php_semver | cut -c 1-3)" != "$version" ]; then if [ ! -e "/usr/bin/php$version" ] || [ ! -e "/usr/bin/php-config$version" ]; then - add_php >/dev/null 2>&1 + add_php else if ! [[ "$version" =~ ${old_versions:?} ]]; then - switch_version >/dev/null 2>&1 + switch_version fi if [ "${update:?}" = "true" ]; then - update_php >/dev/null 2>&1 + update_php else status="Switched to" fi @@ -262,7 +262,7 @@ setup_php() { php_config="$(command -v php-config)" else if [ "$update" = "true" ]; then - update_php >/dev/null 2>&1 + update_php else status="Found" fi @@ -282,7 +282,7 @@ setup_php() { link_pecl_file configure_php set_output "php-version" "$semver" - sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1 + sudo rm -rf /usr/local/bin/phpunit sudo chmod 777 "${ini_file[@]}" "$pecl_file" "${tool_path_dir:?}" sudo cp "$src"/configs/pm/*.json "$RUNNER_TOOL_CACHE/" add_log "${tick:?}" "PHP" "$status PHP $semver$extra_version" @@ -296,8 +296,8 @@ debconf_fix="DEBIAN_FRONTEND=noninteractive" apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends" scripts="$src"/scripts -add_sudo >/dev/null 2>&1 -link_apt_fast >/dev/null 2>&1 +add_sudo +link_apt_fast . /etc/os-release # shellcheck source=. diff --git a/src/scripts/tools/add_tools.ps1 b/src/scripts/tools/add_tools.ps1 index d817bc0c3..5b231be04 100644 --- a/src/scripts/tools/add_tools.ps1 +++ b/src/scripts/tools/add_tools.ps1 @@ -121,7 +121,7 @@ Function Add-ToolsHelper() { $extensions += @('json', 'tokenizer') } elseif($tool -eq "phpDocumentor") { $extensions+=('ctype', 'hash', 'json', 'fileinfo', 'iconv', 'mbstring', 'simplexml', 'xml') - Add-Extension fileinfo >$null 2>&1 + Add-Extension fileinfo Copy-Item $bin_dir\phpDocumentor.bat -Destination $bin_dir\phpdoc.bat } elseif($tool -eq "phpunit") { $extensions += @('dom', 'json', 'libxml', 'mbstring', 'xml', 'xmlwriter') @@ -134,7 +134,7 @@ Function Add-ToolsHelper() { Copy-Item $bin_dir\wp-cli.bat -Destination $bin_dir\wp.bat } foreach($extension in $extensions) { - Add-Extension $extension >$null 2>&1 + Add-Extension $extension } } @@ -181,7 +181,7 @@ Function Add-Tool() { $bat_content += "php %BIN_TARGET% %*" Set-Content -Path $bin_dir\$tool.bat -Value $bat_content Add-ToolsHelper $tool - Add-ToProfile $current_profile $tool "New-Alias $tool $bin_dir\$tool.bat" >$null 2>&1 + Add-ToProfile $current_profile $tool "New-Alias $tool $bin_dir\$tool.bat" $tool_version = Get-ToolVersion $tool $ver_param Add-Log $tick $tool "Added $tool $tool_version" } else { @@ -221,9 +221,9 @@ Function Add-ComposerToolHelper() { Remove-Item -Path $composer_lock -Force } if((composer global show $prefix$tool $tool_version -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) { - composer global config --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1 + composer global config --no-plugins allow-plugins."$prefix$tool" true } - composer global require $prefix$release $composer_args >$null 2>&1 + composer global require $prefix$release $composer_args return composer global show $prefix$tool 2>&1 | findstr '^versions' } else { $release_stream = [System.IO.MemoryStream]::New([System.Text.Encoding]::ASCII.GetBytes($release)) @@ -234,9 +234,9 @@ Function Add-ComposerToolHelper() { New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1 Set-Content -Path $scoped_dir\composer.json -Value "{}" if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) { - composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1 + composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true } - composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1 + composer require $prefix$release -d $unix_scoped_dir $composer_args } [System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin") Add-Path $scoped_dir\vendor\bin diff --git a/src/scripts/tools/add_tools.sh b/src/scripts/tools/add_tools.sh index d58ca61f3..5a92fbe06 100644 --- a/src/scripts/tools/add_tools.sh +++ b/src/scripts/tools/add_tools.sh @@ -132,7 +132,7 @@ add_tools_helper() { sudo ln -s "$tool_path" "$tool_path_dir"/"${tool%-*}" fi for extension in "${extensions[@]}"; do - add_extension "$extension" extension >/dev/null 2>&1 + add_extension "$extension" extension done } @@ -179,22 +179,22 @@ add_composer_tool_helper() { enable_extensions curl mbstring openssl tool_version=${release##*:}; [ "$tool_version" = "$tool" ] && tool_version="*" if [ "$scope" = "global" ]; then - sudo rm -f "$composer_lock" >/dev/null 2>&1 || true + sudo rm -f "$composer_lock" || true if composer global show "$prefix$tool" "$tool_version" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then - composer global config --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1 + composer global config --no-plugins allow-plugins."$prefix$tool" true fi - composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1 - composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1 + composer global require "$prefix$release" "$composer_args" + composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log else scoped_dir="$composer_bin/_tools/$tool-$(echo -n "$release" | shasum -a 256 | cut -d ' ' -f 1)" if ! [ -d "$scoped_dir" ]; then mkdir -p "$scoped_dir" echo '{}' | tee "$scoped_dir/composer.json" >/dev/null if composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then - composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1 + composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true fi - composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1 - composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1 + composer require "$prefix$release" -d "$scoped_dir" "$composer_args" + composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log fi add_path "$scoped_dir"/vendor/bin fi diff --git a/src/scripts/tools/blackfire.ps1 b/src/scripts/tools/blackfire.ps1 index 4427ef7d8..94e6b084f 100644 --- a/src/scripts/tools/blackfire.ps1 +++ b/src/scripts/tools/blackfire.ps1 @@ -6,14 +6,14 @@ Function Add-Blackfire() { } $cli_version = (Invoke-RestMethod https://blackfire.io/api/v1/releases).cli $url = "https://packages.blackfire.io/binaries/blackfire/${cli_version}/blackfire-windows_${arch_name}.zip" - Get-File -Url $url -OutFile $bin_dir\blackfire.zip >$null 2>&1 - Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force >$null 2>&1 + Get-File -Url $url -OutFile $bin_dir\blackfire.zip + Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force Add-ToProfile $current_profile 'blackfire' "New-Alias blackfire $bin_dir\blackfire.exe" if ((Test-Path env:BLACKFIRE_SERVER_ID) -and (Test-Path env:BLACKFIRE_SERVER_TOKEN)) { - blackfire agent:config --server-id=$env:BLACKFIRE_SERVER_ID --server-token=$env:BLACKFIRE_SERVER_TOKEN >$null 2>&1 + blackfire agent:config --server-id=$env:BLACKFIRE_SERVER_ID --server-token=$env:BLACKFIRE_SERVER_TOKEN } if ((Test-Path env:BLACKFIRE_CLIENT_ID) -and (Test-Path env:BLACKFIRE_CLIENT_TOKEN)) { - blackfire client:config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem >$null 2>&1 + blackfire client:config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem } Add-Log $tick "blackfire" "Added blackfire $cli_version" } diff --git a/src/scripts/tools/blackfire.sh b/src/scripts/tools/blackfire.sh index 70fa4f642..a53579f7d 100644 --- a/src/scripts/tools/blackfire.sh +++ b/src/scripts/tools/blackfire.sh @@ -32,9 +32,9 @@ blackfire_config() { # Function to add blackfire cli. add_blackfire() { os="$(uname -s)" - [ "$os" = "Linux" ] && add_blackfire_linux >/dev/null 2>&1 - [ "$os" = "Darwin" ] && add_blackfire_darwin >/dev/null 2>&1 - blackfire_config >/dev/null 2>&1 + [ "$os" = "Linux" ] && add_blackfire_linux + [ "$os" = "Darwin" ] && add_blackfire_darwin + blackfire_config tool_version=$(get_tool_version "blackfire" "version") add_log "${tick:?}" "blackfire" "Added blackfire $tool_version" } diff --git a/src/scripts/tools/brew.sh b/src/scripts/tools/brew.sh index ed808a991..175b35425 100644 --- a/src/scripts/tools/brew.sh +++ b/src/scripts/tools/brew.sh @@ -14,11 +14,11 @@ add_brew_tap() { tap=$1 if ! [ -d "$tap_dir/$tap" ]; then if [ "${runner:?}" = "self-hosted" ]; then - brew tap "$tap" >/dev/null 2>&1 + brew tap "$tap" else - fetch_brew_tap "$tap" >/dev/null 2>&1 + fetch_brew_tap "$tap" if ! [ -d "$tap_dir/$tap" ]; then - brew tap "$tap" >/dev/null 2>&1 + brew tap "$tap" fi fi fi @@ -49,7 +49,7 @@ add_brew() { brew_prefix="$(get_brew_prefix)" if ! [ -d "$brew_prefix"/bin ]; then step_log "Setup Brew" - get -s "" "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" | bash -s >/dev/null 2>&1 + get -s "" "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" | bash -s add_log "${tick:?}" "Brew" "Installed Homebrew" fi add_brew_bins_to_path "$brew_prefix" diff --git a/src/scripts/tools/grpc_php_plugin.ps1 b/src/scripts/tools/grpc_php_plugin.ps1 index f40bf2814..a1c9650ff 100644 --- a/src/scripts/tools/grpc_php_plugin.ps1 +++ b/src/scripts/tools/grpc_php_plugin.ps1 @@ -1,7 +1,7 @@ Function Add-Msys2() { $msys_location = 'C:\msys64' if (-not(Test-Path $msys_location)) { - choco install msys2 -y >$null 2>&1 + choco install msys2 -y $msys_location = 'C:\tools\msys64' } return $msys_location @@ -9,7 +9,7 @@ Function Add-Msys2() { Function Add-GrpcPhpPlugin() { $msys_location = Add-Msys2 - $logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" >$null 2>&1 + $logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" $grpc_version = Get-ToolVersion 'Write-Output' "$logs" Add-Path $msys_location\mingw64\bin Set-Output grpc_php_plugin_path "$msys_location\mingw64\bin\grpc_php_plugin.exe" diff --git a/src/scripts/tools/grpc_php_plugin.sh b/src/scripts/tools/grpc_php_plugin.sh index 9434bb16e..cea30916c 100644 --- a/src/scripts/tools/grpc_php_plugin.sh +++ b/src/scripts/tools/grpc_php_plugin.sh @@ -26,7 +26,7 @@ add_grpc_php_plugin_brew() { configure_brew [ -e /usr/local/bin/protoc ] && sudo mv /usr/local/bin/protoc /tmp/protoc && sudo mv /usr/local/include/google /tmp brew install grpc - brew link --force --overwrite grpc >/dev/null 2>&1 + brew link --force --overwrite grpc [ -e /tmp/protoc ] && sudo mv /tmp/protoc /usr/local/bin/protoc && sudo mv /tmp/google /usr/local/include/ grpc_tag="v$(brew info grpc | grep "grpc:" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")" license_path="$(brew --prefix grpc)/LICENSE" @@ -50,9 +50,9 @@ add_grpc_php_plugin() { grpc_tag=$1 license_path="" if [ "$grpc_tag" = "latest" ]; then - add_grpc_php_plugin_brew >/dev/null 2>&1 + add_grpc_php_plugin_brew else - add_grpc_php_plugin_compile >/dev/null 2>&1 + add_grpc_php_plugin_compile fi set_output grpc_php_plugin_path "$(command -v grpc_php_plugin)" add_log "${tick:?}" "grpc_php_plugin" "Added grpc_php_plugin ${grpc_tag:1}" diff --git a/src/scripts/tools/ppa.sh b/src/scripts/tools/ppa.sh index ec0826d7c..b41b35187 100644 --- a/src/scripts/tools/ppa.sh +++ b/src/scripts/tools/ppa.sh @@ -31,7 +31,7 @@ set_base_version() { else set_base_version_codename set_base_version_id - printf "ID=%s\nVERSION_ID=%s\nVERSION_CODENAME=%s\n" "$ID" "$VERSION_ID" "$VERSION_CODENAME" | tee /tmp/os-release >/dev/null 2>&1 + printf "ID=%s\nVERSION_ID=%s\nVERSION_CODENAME=%s\n" "$ID" "$VERSION_ID" "$VERSION_CODENAME" | tee /tmp/os-release fi } @@ -59,8 +59,8 @@ update_lists() { list="$list_file" fi if [ ! -e "$status_file" ]; then - update_lists_helper "$list" >/dev/null 2>&1 - echo '' | tee "$status_file" >/dev/null 2>&1 + update_lists_helper "$list" + echo '' | tee "$status_file" fi } @@ -95,7 +95,7 @@ add_key() { fi [ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}" if [[ "$(file "$key_file")" =~ .*('Public-Key (old)'|'Secret-Key') ]]; then - sudo gpg --batch --yes --dearmor "$key_file" >/dev/null 2>&1 && sudo mv "$key_file".gpg "$key_file" + sudo gpg --batch --yes --dearmor "$key_file" && sudo mv "$key_file".gpg "$key_file" fi } @@ -129,7 +129,7 @@ add_list() { arch=$(dpkg --print-architecture) [ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file" - echo "deb [arch=$arch signed-by=$key_file] $ppa_url $package_dist $branches" | sudo tee -a "$list_dir"/"${ppa/\//-}".list >/dev/null 2>&1 + echo "deb [arch=$arch signed-by=$key_file] $ppa_url $package_dist $branches" | sudo tee -a "$list_dir"/"${ppa/\//-}".list update_lists "$ppa" "$ppa_search" . /etc/os-release fi diff --git a/src/scripts/tools/protoc.ps1 b/src/scripts/tools/protoc.ps1 index ea5e6172e..f3dd4c919 100644 --- a/src/scripts/tools/protoc.ps1 +++ b/src/scripts/tools/protoc.ps1 @@ -29,8 +29,8 @@ Function Add-Protoc() { $arch_num = '32' } $url = "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-$($protobuf_tag -replace 'v', '')-win$arch_num.zip" - Get-File -Url $url -OutFile $bin_dir\protoc.zip >$null 2>&1 - Expand-Archive -Path $bin_dir\protoc.zip -DestinationPath $bin_dir\protoc -Force >$null 2>&1 + Get-File -Url $url -OutFile $bin_dir\protoc.zip + Expand-Archive -Path $bin_dir\protoc.zip -DestinationPath $bin_dir\protoc -Force Move-Item -Path $bin_dir\protoc\bin\protoc.exe -Destination $bin_dir\protoc.exe Add-ToProfile $current_profile 'protoc' "New-Alias protoc $bin_dir\protoc.exe" Add-Log $tick "protoc" "Added protoc $($protobuf_tag -replace 'v', '')" diff --git a/src/scripts/tools/protoc.sh b/src/scripts/tools/protoc.sh index ad00fb695..3a983fb76 100644 --- a/src/scripts/tools/protoc.sh +++ b/src/scripts/tools/protoc.sh @@ -20,7 +20,7 @@ add_protoc() { get -q -n /tmp/protobuf.zip "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-${protobuf_tag:1}-$platform-x86_64.zip" sudo unzip /tmp/protobuf.zip -d /usr/local/ sudo chmod -R 777 /usr/local/bin/protoc /usr/local/include/google - ) >/dev/null 2>&1 + ) add_log "${tick:?}" "protoc" "Added protoc ${protobuf_tag:1}" printf "$GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "protoc" "Click to read the protoc related license information" curl "${curl_opts[@]:?}" https://raw.githubusercontent.com/protocolbuffers/protobuf/master/LICENSE diff --git a/src/scripts/tools/symfony.ps1 b/src/scripts/tools/symfony.ps1 index 3c334d2fa..03116fa33 100644 --- a/src/scripts/tools/symfony.ps1 +++ b/src/scripts/tools/symfony.ps1 @@ -4,8 +4,8 @@ Function Add-Symfony() { $arch_name = '386' } $url = "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_windows_${arch_name}.zip" - Get-File -Url $url -OutFile $bin_dir\symfony.zip >$null 2>&1 - Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force >$null 2>&1 + Get-File -Url $url -OutFile $bin_dir\symfony.zip + Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force if(Test-Path $bin_dir\symfony.exe) { Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe > $null 2>&1 Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe" diff --git a/src/scripts/tools/symfony.sh b/src/scripts/tools/symfony.sh index 03d2de240..090761ce7 100644 --- a/src/scripts/tools/symfony.sh +++ b/src/scripts/tools/symfony.sh @@ -29,7 +29,7 @@ add_symfony_helper() { } add_symfony() { - add_symfony_helper >/dev/null 2>&1 + add_symfony_helper symfony_path="$(command -v symfony)" if [[ -n "$symfony_path" ]]; then sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli diff --git a/src/scripts/unix.sh b/src/scripts/unix.sh index f8905025a..60a44f7b6 100644 --- a/src/scripts/unix.sh +++ b/src/scripts/unix.sh @@ -43,7 +43,7 @@ set_output() { name=$1 value=$2 if [ "${GITHUB_ACTIONS}" = "true" ]; then - echo "${name}=${value}" | tee -a "$GITHUB_OUTPUT" >/dev/null 2>&1 + echo "${name}=${value}" | tee -a "$GITHUB_OUTPUT" fi } @@ -113,10 +113,10 @@ add_path() { path_to_add=$1 [[ ":$PATH:" == *":$path_to_add:"* ]] && return if [[ -n "$GITHUB_PATH" ]]; then - echo "$path_to_add" | tee -a "$GITHUB_PATH" >/dev/null 2>&1 + echo "$path_to_add" | tee -a "$GITHUB_PATH" else profile=$(get_shell_profile) - ([ -e "$profile" ] && grep -q ":$path_to_add\"" "$profile" 2>/dev/null) || echo "export PATH=\"\${PATH:+\${PATH}:}\"$path_to_add" | sudo tee -a "$profile" >/dev/null 2>&1 + ([ -e "$profile" ] && grep -q ":$path_to_add\"" "$profile" 2>/dev/null) || echo "export PATH=\"\${PATH:+\${PATH}:}\"$path_to_add" | sudo tee -a "$profile" fi export PATH="${PATH:+${PATH}:}$path_to_add" } @@ -138,10 +138,10 @@ add_env() { env_name=$1 env_value=$2 if [[ -n "$GITHUB_ENV" ]]; then - echo "$env_name=$env_value" | tee -a "$GITHUB_ENV" >/dev/null 2>&1 + echo "$env_name=$env_value" | tee -a "$GITHUB_ENV" else profile=$(get_shell_profile) - echo "export $env_name=\"$env_value\"" | sudo tee -a "$profile" >/dev/null 2>&1 + echo "export $env_name=\"$env_value\"" | sudo tee -a "$profile" fi export "$env_name"="$env_value" } @@ -162,7 +162,7 @@ self_hosted_setup() { add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner" exit 1 else - self_hosted_helper >/dev/null 2>&1 + self_hosted_helper add_env RUNNER_TOOL_CACHE /tmp fi fi @@ -175,8 +175,8 @@ configure_php() { ini_config_files=("$ini_config_dir"/php.ini) jit_config_files=("$ini_config_dir"/jit.ini) [[ "$version" =~ $xdebug3_versions ]] && ini_config_files+=("$ini_config_dir"/xdebug.ini) - cat "${ini_config_files[@]}" | sudo tee -a "${ini_file[@]:?}" >/dev/null 2>&1 - [[ "$version" =~ $jit_versions ]] && cat "${jit_config_files[@]}" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1 + cat "${ini_config_files[@]}" | sudo tee -a "${ini_file[@]:?}" + [[ "$version" =~ $jit_versions ]] && cat "${jit_config_files[@]}" | sudo tee -a "${pecl_file:-${ini_file[@]}}" } # Function to get PHP version in semver format. diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index b03eb299c..51c34cd72 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -355,7 +355,7 @@ if(-not($env:ImageOS) -and -not($env:ImageVersion)) { $bin_dir = 'C:\tools\bin' $php_dir = "$php_dir$version" $ext_dir = "$php_dir\ext" - Get-CleanPSProfile >$null 2>&1 + Get-CleanPSProfile New-Item $bin_dir -Type Directory -Force > $null 2>&1 Add-Path -PathItem $bin_dir if($version -lt 5.6) { @@ -368,12 +368,12 @@ if(-not($env:ImageOS) -and -not($env:ImageVersion)) { } New-Item $php_dir -Type Directory -Force > $null 2>&1 Add-Path -PathItem $php_dir - setx PHPROOT $php_dir >$null 2>&1 + setx PHPROOT $php_dir Add-Env -EnvName RUNNER_TOOL_CACHE -EnvValue $env:TEMP } else { $current_profile = "$PSHOME\Profile.ps1" if(-not(Test-Path -LiteralPath $current_profile)) { - New-Item -Path $current_profile -ItemType "file" -Force >$null 2>&1 + New-Item -Path $current_profile -ItemType "file" -Force } } @@ -381,9 +381,9 @@ $src = Join-Path -Path $PSScriptRoot -ChildPath \.. . $src\scripts\tools\add_tools.ps1 . $src\scripts\extensions\add_extensions.ps1 -Add-Printf >$null 2>&1 +Add-Printf Step-Log "Setup PhpManager" -Install-PSPackage PhpManager PhpManager\PhpManager "$github/mlocati/powershell-phpmanager/releases/latest/download/PhpManager.zip" Get-Php >$null 2>&1 +Install-PSPackage PhpManager PhpManager\PhpManager "$github/mlocati/powershell-phpmanager/releases/latest/download/PhpManager.zip" Get-Php Add-Log $tick "PhpManager" "Installed" Step-Log "Setup PHP" @@ -403,7 +403,7 @@ $status = "Installed" $extra_version = "" if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) { if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) { - Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1 + Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList } try { if ($version -match $nightly_versions) { @@ -416,7 +416,7 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version } catch { } } else { if($env:update -eq 'true') { - Update-Php $php_dir >$null 2>&1 + Update-Php $php_dir $status = "Updated to" } else { $status = "Found" @@ -434,7 +434,7 @@ if($installed.MajorMinorVersion -ne $version) { Write-Error "Could not setup PHP $version" -ErrorAction Stop } if($version -lt "5.5") { - ('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Get-File -Url "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ >$null 2>&1 } + ('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Get-File -Url "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ } } else { $enable_extensions += ('opcache') } diff --git a/src/utils.ts b/src/utils.ts index 79c157d69..21fca5dbe 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -278,10 +278,10 @@ export async function getExtensionPrefix(extension: string): Promise { export async function suppressOutput(os: string): Promise { switch (os) { case 'win32': - return ' >$null 2>&1'; + return ' '; case 'linux': case 'darwin': - return ' >/dev/null 2>&1'; + return ' '; default: return await log('Platform ' + os + ' is not supported', os, 'error'); }