Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/commands/firewall/trust_after_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,15 @@ func findModuleLaunchers(name string) []string {
add(filepath.Join(appdata, "npm", name+".cmd"))
add(filepath.Join(appdata, "npm", name+".bat"))
}

// Standalone pnpm (get.pnpm.io): PNPM_HOME\bin\pnpm.cmd
if strings.EqualFold(name, "pnpm") {
if home := strings.TrimSpace(os.Getenv("PNPM_HOME")); home != "" {
add(filepath.Join(home, "bin", name+".cmd"))
add(filepath.Join(home, "bin", name+".bat"))
add(filepath.Join(home, name+".cmd"))
add(filepath.Join(home, name+".bat"))
}
}
return out
}
6 changes: 5 additions & 1 deletion src/commands/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ func (c *Doctor) Run() error {
return cmd.Run()
}

type Reshim struct{}
type Reshim struct {
// Force is accepted for compatibility with reshim.exe / hint text ("nvm reshim --force").
// sync.exe reshim always passes --force to reshim.exe, so this flag is a no-op.
Force bool `flag:"force" help:"Force recreation of locked shims (always applied by sync)."`
}

func (c *Reshim) Run() error {
sync, err := getSyncToolPath()
Expand Down
12 changes: 12 additions & 0 deletions src/test/commands/cli_t5_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ func TestCLIReshimCommand(t *testing.T) {
}
}

func TestCLIReshimForceFlagAccepted(t *testing.T) {
sb := clitest.NewSandbox(t)

stdout, stderr, err := sb.ExecuteWithSyncStub("reshim", "--force")
if err != nil {
t.Fatalf("Execute(reshim --force) error = %v stderr = %q stdout = %q", err, stderr, stdout)
}
if strings.Contains(stderr, "unknown flag") {
t.Fatalf("Execute(reshim --force) stderr = %q, flag should be accepted", stderr)
}
}

func TestCLIDoctorCommand(t *testing.T) {
sb := clitest.NewSandbox(t)

Expand Down
Loading