Skip to content

Commit

Permalink
Fix how nvm installs node (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnstn authored Nov 7, 2023
1 parent 819e325 commit 56cf8bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ func SetupNode(dir string) error {

// Check for nvm
if os.Getenv("NVM_DIR") != "" {
console.Info("Setting up node via nvm in %s", dir)
cmd = exec.Command("bash", "-l", "-c", "$NVM_DIR/nvm.sh", "use")
cmd = exec.Command("bash", "-l", "-c", ". $NVM_DIR/nvm.sh && nvm use")
cmd.Path = "/bin/bash"
}

// @TODO check for asdf and set up the command accordingly

if cmd == nil {
console.Warn("No node version manager found. Using system node.")
return nil
}
cmd.Dir = dir
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit 56cf8bb

Please sign in to comment.