Skip to content

Commit

Permalink
fix: upgrade cli command
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmueller committed Dec 14, 2017
1 parent 50e083d commit f4d7fd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/cli/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"

"github.com/apex/log"
Expand Down Expand Up @@ -109,7 +110,8 @@ func upgrade(ctx context.Context, version string) (err error) {
// findAsset returns the binary for this platform.
func findAsset(release *github.RepositoryRelease) *github.ReleaseAsset {
for _, asset := range release.Assets {
if *asset.Name == fmt.Sprintf("joy_%s_%s", runtime.GOOS, runtime.GOARCH) {
version := strings.TrimPrefix(*release.TagName, "v")
if *asset.Name == fmt.Sprintf("joy_%s_%s_%s.tar.gz", version, runtime.GOOS, runtime.GOARCH) {
return &asset
}
}
Expand Down

0 comments on commit f4d7fd7

Please sign in to comment.