cord-776 create build / runtime containers for autmation uservices
Change-Id: I246973192adef56a250ffe93a5f65fff488840c1
diff --git a/switchq/vendor/github.com/juju/utils/home_windows.go b/switchq/vendor/github.com/juju/utils/home_windows.go
new file mode 100644
index 0000000..e61225c
--- /dev/null
+++ b/switchq/vendor/github.com/juju/utils/home_windows.go
@@ -0,0 +1,25 @@
+// Copyright 2013 Canonical Ltd.
+// Licensed under the LGPLv3, see LICENCE file for details.
+
+package utils
+
+import (
+ "os"
+ "path/filepath"
+)
+
+// Home returns the os-specific home path as specified in the environment.
+func Home() string {
+ return filepath.Join(os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH"))
+}
+
+// SetHome sets the os-specific home path in the environment.
+func SetHome(s string) error {
+ v := filepath.VolumeName(s)
+ if v != "" {
+ if err := os.Setenv("HOMEDRIVE", v); err != nil {
+ return err
+ }
+ }
+ return os.Setenv("HOMEPATH", s[len(v):])
+}