mirror of
https://github.com/Azure/setup-helm.git
synced 2026-04-14 10:34:47 +00:00
Compiled to js
This commit is contained in:
parent
102789f73d
commit
91434c9853
2 changed files with 181 additions and 153 deletions
|
|
@ -106,10 +106,10 @@ export async function downloadHelm(version: string): Promise<string> {
|
|||
}
|
||||
|
||||
async function getLatestHelmVersion(): Promise<string>{
|
||||
|
||||
const command:string = `curl -Ls https://api.github.com/repos/helm/helm/releases | grep 'v3.[0-9]*.[0-9]*' | sed -E 's/ .*\/helm\/helm\/releases\/tag\/tag\/(v[0-9\.]+)".*/\1/g' | head -1 | sed -E 's/.*tag\///' | sed -E 's/".*//'`;
|
||||
let latestHelm: string = "";
|
||||
let latestHelmErr: string = "";
|
||||
|
||||
|
||||
const options:ExecOptions = {};
|
||||
|
||||
options.listeners = {
|
||||
|
|
@ -120,8 +120,8 @@ async function getLatestHelmVersion(): Promise<string>{
|
|||
latestHelmErr += data.toString();
|
||||
}
|
||||
};
|
||||
|
||||
await exec.exec('curl', [`-Ls ${helmAllReleasesUrl} | grep 'v3.[0-9]*.[0-9]*' | sed -E 's/ .*\/helm\/helm\/releases\/tag\/tag\/(v[0-9\.]+)".*/\1/g' | head -1 | sed -E 's/.*tag\///' | sed -E 's/".*//'`], options);
|
||||
|
||||
await exec.exec(command, [], options);
|
||||
|
||||
if(latestHelmErr !== "") return getStableHelmVersion();
|
||||
return latestHelm;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue