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"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dapr/cli/pkg/print"
|
||||
|
|
@ -90,7 +91,7 @@ func getVersion(version string) (string, error) {
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("cannot get the latest release version: %s", err)
|
||||
}
|
||||
version = version[1:]
|
||||
version = strings.TrimPrefix(version, "v")
|
||||
}
|
||||
return version, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ func GetLatestReleaseGithub(githubURL string) (string, error) {
|
|||
|
||||
for _, release := range githubRepoReleases {
|
||||
if !strings.Contains(release.TagName, "-rc") {
|
||||
return release.TagName[1:], nil
|
||||
return strings.TrimPrefix(release.TagName, "v"), nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue