The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/distrobuilder/pull/17
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Resolves #12. Signed-off-by: Thomas Hipp <[email protected]>
From 6db895de08aaede6bfcae3a4da794f476e70cc15 Mon Sep 17 00:00:00 2001 From: Thomas Hipp <[email protected]> Date: Wed, 21 Feb 2018 19:28:28 +0100 Subject: [PATCH] *: Remove init() code Resolves #12. Signed-off-by: Thomas Hipp <[email protected]> --- distrobuilder/main.go | 6 ------ shared/util.go | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/distrobuilder/main.go b/distrobuilder/main.go index 48e90ec..f25b8ee 100644 --- a/distrobuilder/main.go +++ b/distrobuilder/main.go @@ -60,12 +60,6 @@ import ( yaml "gopkg.in/yaml.v2" ) -func init() { - os.Setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin") - os.Setenv("SHELL", "/bin/sh") - os.Setenv("TERM", "xterm") -} - func main() { app := cli.NewApp() app.Usage = "image generator" diff --git a/shared/util.go b/shared/util.go index ddac11c..f18daaa 100644 --- a/shared/util.go +++ b/shared/util.go @@ -40,6 +40,11 @@ func Copy(src, dest string) error { func RunCommand(name string, arg ...string) error { cmd := exec.Command(name, arg...) + cmd.Env = []string{ + "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin", + "SHELL=/bin/sh", + "TERM=xterm"} + cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
