This commit is contained in:
parent
4abad1ec71
commit
d9f73b953d
|
@ -113,20 +113,20 @@ func pipeCommands(username string, commands ...*exec.Cmd) string {
|
||||||
for i, command := range commands[:len(commands)-1] {
|
for i, command := range commands[:len(commands)-1] {
|
||||||
setCmdEnv(command, username)
|
setCmdEnv(command, username)
|
||||||
|
|
||||||
out, err := command.StdoutPipe()
|
stdout, err := command.StdoutPipe()
|
||||||
|
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return err.Error()
|
return err.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
command.Start()
|
command.Start()
|
||||||
commands[i+1].Stdin = out
|
|
||||||
|
commands[i+1].Stdin = stdout
|
||||||
}
|
}
|
||||||
|
|
||||||
last := commands[len(commands)-1]
|
last := commands[len(commands)-1]
|
||||||
setCmdEnv(last, username)
|
setCmdEnv(last, username)
|
||||||
|
|
||||||
out, err := last.Output()
|
out, err := last.CombinedOutput()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err.Error()
|
return err.Error()
|
||||||
|
@ -139,7 +139,7 @@ func setCmdEnv(cmd *exec.Cmd, username string) {
|
||||||
userWorkspace := conf.Wide.GetUserWorkspace(username)
|
userWorkspace := conf.Wide.GetUserWorkspace(username)
|
||||||
|
|
||||||
cmd.Env = append(cmd.Env,
|
cmd.Env = append(cmd.Env,
|
||||||
"TERM=xterm",
|
"TERM="+os.Getenv("TERM"),
|
||||||
"GOPATH="+userWorkspace,
|
"GOPATH="+userWorkspace,
|
||||||
"GOOS="+runtime.GOOS,
|
"GOOS="+runtime.GOOS,
|
||||||
"GOARCH="+runtime.GOARCH,
|
"GOARCH="+runtime.GOARCH,
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<div id="dirRMenu" class="menu-r fn-none">
|
<div id="dirRMenu" class="menu-r fn-none">
|
||||||
<ul>
|
<ul>
|
||||||
<li onclick="tree.newFile();">{{.i18n.create_file}}</li>
|
<li onclick="tree.newFile();">{{.i18n.create_file}}</li>
|
||||||
<li onclick="tree.newDir();">{{.i18n.create_file}}</li>
|
<li onclick="tree.newDir();">{{.i18n.create_dir}}</li>
|
||||||
<li onclick="tree.removeIt();">{{.i18n.delete}}</li>
|
<li onclick="tree.removeIt();">{{.i18n.delete}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue