You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/09/09 16:21:00 UTC

[3/4] incubator-mynewt-newt git commit: MYNEWT-363; newt run resets the target, newt debug does not. Also changed parameters to debug script to be environment variables instead of command line parameters.

MYNEWT-363; newt run resets the target, newt debug does not.
Also changed parameters to debug script to be environment variables
instead of command line parameters.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/682c0a2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/682c0a2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/682c0a2c

Branch: refs/heads/develop
Commit: 682c0a2c4fa55062f7f0321bc7a8350c90177538
Parents: 1a644f6
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Sep 8 19:50:47 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Sep 9 09:19:04 2016 -0700

----------------------------------------------------------------------
 util/util.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/682c0a2c/util/util.go
----------------------------------------------------------------------
diff --git a/util/util.go b/util/util.go
index 75fc5f0..27b407c 100644
--- a/util/util.go
+++ b/util/util.go
@@ -293,7 +293,7 @@ func ShellCommand(cmdStr string) ([]byte, error) {
 }
 
 // Run interactive shell command
-func ShellInteractiveCommand(cmdStr []string) error {
+func ShellInteractiveCommand(cmdStr []string, env []string) error {
 	log.Print("[VERBOSE] " + cmdStr[0])
 
 	//
@@ -307,9 +307,12 @@ func ShellInteractiveCommand(cmdStr []string) error {
 		<-c
 	}()
 
+	env = append(env, os.Environ()...)
 	// Transfer stdin, stdout, and stderr to the new process
 	// and also set target directory for the shell to start in.
+	// and set the additional environment variables
 	pa := os.ProcAttr{
+		Env:   env,
 		Files: []*os.File{os.Stdin, os.Stdout, os.Stderr},
 	}