Skip to content

Commit ff061bb

Browse files
feat(upgrade): forward --force to sync
Skip the process-close warning when the caller asks for a silent upgrade. Co-authored-by: Cursor
1 parent fe08afe commit ff061bb

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎src/commands/sync.go‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package commands
33
import (
44
"common/settings"
55
"fmt"
6-
"nvm/constant"
76
"nvm/bootstrap"
7+
"nvm/constant"
88
"os"
99
"os/exec"
1010
"path/filepath"
1111
)
1212

1313
type Upgrade struct {
1414
Check bool `flag:"check" help:"Check for updates without performing the upgrade."`
15+
Force bool `flag:"force" help:"Upgrade without warning about processes that will be closed."`
1516
}
1617

1718
func (s *Upgrade) Run() error {
@@ -35,6 +36,9 @@ func (s *Upgrade) Run() error {
3536
if s.Check {
3637
cmd.Args = append(cmd.Args, "--check")
3738
}
39+
if s.Force {
40+
cmd.Args = append(cmd.Args, "--force")
41+
}
3842

3943
cmd.Stdout = os.Stdout
4044
cmd.Stderr = os.Stderr
@@ -49,6 +53,7 @@ type Doctor struct {
4953
Autofix bool `flag:"autofix" help:"Automatically fix issues when possible."`
5054
List bool `flag:"list" help:"List all available checks without running them."`
5155
Update bool `flag:"update" help:"Force sync utility asset update before running checks."`
56+
Force bool `flag:"force" help:"When upgrading, do not warn about processes that will be closed."`
5257
constant.FlagJSON
5358
}
5459

@@ -68,6 +73,9 @@ func (c *Doctor) Run() error {
6873
if c.Update {
6974
args = append(args, "--update")
7075
}
76+
if c.Force {
77+
args = append(args, "--force")
78+
}
7179
if c.JSON {
7280
args = append(args, "--json")
7381
}

0 commit comments

Comments
 (0)