mirror of https://github.com/dapr/cli.git
Fixing removal of "v" from release version
This commit is contained in:
parent
19131133e9
commit
6f2063bd4f
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dapr/cli/pkg/print"
|
"github.com/dapr/cli/pkg/print"
|
||||||
|
|
@ -90,7 +91,7 @@ func getVersion(version string) (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("cannot get the latest release version: %s", err)
|
return "", fmt.Errorf("cannot get the latest release version: %s", err)
|
||||||
}
|
}
|
||||||
version = version[1:]
|
version = strings.TrimPrefix(version, "v")
|
||||||
}
|
}
|
||||||
return version, nil
|
return version, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ func GetLatestReleaseGithub(githubURL string) (string, error) {
|
||||||
|
|
||||||
for _, release := range githubRepoReleases {
|
for _, release := range githubRepoReleases {
|
||||||
if !strings.Contains(release.TagName, "-rc") {
|
if !strings.Contains(release.TagName, "-rc") {
|
||||||
return release.TagName[1:], nil
|
return strings.TrimPrefix(release.TagName, "v"), nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue