Skip to content

Commit

Permalink
fix instal with --tags
Browse files Browse the repository at this point in the history
  • Loading branch information
hidu committed Aug 3, 2024
1 parent 289009b commit f5bea96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Self-Update :
Site : https://github.com/fsgo/gopt
Version : dev
Date : 2024-07-31
Date : 2024-08-03
`

func init() {
Expand Down
3 changes: 2 additions & 1 deletion internal/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ func (i *installer) installOne(name string) error {
}
ctx, cancel := context.WithTimeout(context.Background(), i.getTimeout())
defer cancel()
args := []string{"install", info.Path + "@" + version}
args := []string{"install"}
if info.Tags != "" {
args = append(args, "--tags", info.Tags)
}
args = append(args, info.Path+"@"+version)
cmd := newGoCommand(ctx, args...)
oe := &cmdutil.OSEnv{}
oe.WithEnviron(cmd.Environ())
Expand Down
2 changes: 1 addition & 1 deletion internal/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (u *updater) install(ctx context.Context, bi *buildinfo.BuildInfo, rawName
// 先安装到临时目录,然后再替换
useRawDir := filepath.Base(bi.Path)+exe() == filepath.Base(rawName)

biEnv := make(map[string]string)
biEnv := make(map[string]string, len(bi.Settings))
args := []string{"install"}
for _, tm := range bi.Settings {
switch tm.Key {
Expand Down

0 comments on commit f5bea96

Please sign in to comment.