Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
moqsien committed Dec 25, 2024
1 parent 38c2a73 commit 21816ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/self/uninstall_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ rm -rf %s`

var WinRemoveScript string = `cd %HOMEPATH%
vmr Uins
rmdir /s /q %s`
rmdir /s /q `

var WinMingwRemoveScript string = `#!/bin/sh
powershell %s`

func SetUninstallScript() {
script := UnixRemoveScript
script := fmt.Sprintf(UnixRemoveScript, cnf.GetVMRWorkDir())
scriptName := unInstallScriptName
if runtime.GOOS == gutils.Windows {
script = WinRemoveScript
script = WinRemoveScript + cnf.GetVMRWorkDir()
scriptName = unInstallScriptName + ".bat"
}
script = fmt.Sprintf(script, cnf.GetVMRWorkDir())

scriptPath := filepath.Join(cnf.GetVMRWorkDir(), scriptName)
os.WriteFile(scriptPath, []byte(script), os.ModePerm)
Expand Down

0 comments on commit 21816ee

Please sign in to comment.