浏览代码

Interactive mode preserves existing PATH, to facilitate scripting

Solomon Hykes 12 年之前
父节点
当前提交
db4c75f3c1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      client/client.go

+ 1 - 1
client/client.go

@@ -112,7 +112,7 @@ func InteractiveMode(scripts ...string) error {
 		return err
 		return err
 	}
 	}
 	io.WriteString(rcfile, "enable -n help\n")
 	io.WriteString(rcfile, "enable -n help\n")
-	os.Setenv("PATH", tmp)
+	os.Setenv("PATH", tmp + ":" + os.Getenv("PATH"))
 	os.Setenv("PS1", "\\h docker> ")
 	os.Setenv("PS1", "\\h docker> ")
 	shell := exec.Command("/bin/bash", append([]string{"--rcfile", rcfile.Name()}, scripts...)...)
 	shell := exec.Command("/bin/bash", append([]string{"--rcfile", rcfile.Name()}, scripts...)...)
 	shell.Stdin = os.Stdin
 	shell.Stdin = os.Stdin