Skip to content

Commit

Permalink
fixed broken use command
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanisham committed Mar 28, 2024
1 parent 083c2ad commit 0ff91e7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cli/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"path/filepath"
"strings"

"github.com/charmbracelet/log"
// "github.com/charmbracelet/log"
"github.com/tristanisham/zvm/cli/meta"
)

Expand All @@ -30,24 +30,22 @@ func (z *ZVM) Use(ver string) error {
}
}
}

return z.setBin(ver)
}

func (z *ZVM) setBin(ver string) error {
// .zvm/master
version_path := filepath.Join(z.baseDir, ver)
if err := os.Remove(filepath.Join(z.baseDir, "bin")); err != nil {
log.Warn(err)
}

if err := meta.Symlink(filepath.Join(z.baseDir, ver), filepath.Join(z.baseDir, "bin")); err != nil {
return err
}

if err := meta.Symlink(version_path, filepath.Join(z.baseDir, "bin")); err != nil {
return err
}


return nil
}

Expand Down

0 comments on commit 0ff91e7

Please sign in to comment.