From b9025c6f7eb27e42af28460730c5ecff05f65c9f Mon Sep 17 00:00:00 2001 From: daveberrys <84567826+daveberrys@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:13:23 +0800 Subject: [PATCH] windows heads-up discalimer --- src/cmd/cli/remove.go | 7 +++++++ src/cmd/cli/update.go | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cmd/cli/remove.go b/src/cmd/cli/remove.go index b97c5f1..9a4b9d8 100644 --- a/src/cmd/cli/remove.go +++ b/src/cmd/cli/remove.go @@ -3,6 +3,7 @@ package cli import ( "fmt" "os" + "runtime" "github.com/spf13/cobra" ) @@ -19,6 +20,12 @@ var removeCmd = &cobra.Command{ err := os.Remove(sysExec) if err != nil { return err } + if runtime.GOOS == "windows" { + fmt.Println("\nThe binary may not be deleted due to Windows' permission issue.") + fmt.Println("If you wish to delete the binary, please run the following command in PowerShell:") + fmt.Printf(" del '%s'\n", sysExec) + } + return nil }, } \ No newline at end of file diff --git a/src/cmd/cli/update.go b/src/cmd/cli/update.go index 9d35b7d..750fc0e 100644 --- a/src/cmd/cli/update.go +++ b/src/cmd/cli/update.go @@ -101,6 +101,12 @@ func doUpdateSequence() error { os.WriteFile(tmpPath, binData, 0755) os.Rename(tmpPath, exePath) - fmt.Println("Update successful!") + if runtime.GOOS == "windows" { + fmt.Println("\nThe update may not take effect due to Windows' permission issue.") + fmt.Println("If you wish to update, please run the following command in PowerShell:") + fmt.Printf(" move '%s' '%s'\n", tmpPath, exePath) + } else { + fmt.Println("Update successful!") + } return nil }