use exec to prevent spawn unneeded subprocess

This commit is contained in:
Chenyang Liu
2016-04-23 18:14:09 -04:00
committed by David Dollar
parent d7a88f3b3a
commit 5d3c4e433e
+1 -1
View File
@@ -16,7 +16,7 @@ func ShellInvocationCommand(interactive bool, root, command string) []string {
shellArgument = "-ic"
}
profile := filepath.Join(root, ".profile")
shellCommand := fmt.Sprintf("source \"%s\" 2>/dev/null; %s", profile, command)
shellCommand := fmt.Sprintf("source \"%s\" 2>/dev/null; exec %s", profile, command)
return []string{"bash", shellArgument, shellCommand}
}