mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-14 07:03:17 +08:00
Use filepath.join to escape whitespace
This commit is contained in:
@@ -375,7 +375,7 @@ func use(version string, cpuarch string) {
|
||||
// Create or update the symlink
|
||||
sym, _ := os.Stat(env.symlink)
|
||||
if sym != nil {
|
||||
cmd := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "rmdir", env.symlink)
|
||||
cmd := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "rmdir", filepath.Clean(env.symlink))
|
||||
var output bytes.Buffer
|
||||
var _stderr bytes.Buffer
|
||||
cmd.Stdout = &output
|
||||
@@ -387,7 +387,7 @@ func use(version string, cpuarch string) {
|
||||
}
|
||||
}
|
||||
|
||||
c := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "mklink", "/D", env.symlink, filepath.Join(env.root, "v"+version))
|
||||
c := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "mklink", "/D", filepath.Clean(env.symlink), filepath.Join(env.root, "v"+version))
|
||||
var out bytes.Buffer
|
||||
var stderr bytes.Buffer
|
||||
c.Stdout = &out
|
||||
|
||||
Reference in New Issue
Block a user