mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Use USERPROFILE path on Windows as home directory
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
This commit is contained in:
parent
e45b0f9271
commit
d4dbb70832
1 changed files with 9 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/docker/docker/opts"
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
|
@ -16,10 +17,17 @@ var (
|
|||
|
||||
func init() {
|
||||
if dockerCertPath == "" {
|
||||
dockerCertPath = filepath.Join(os.Getenv("HOME"), ".docker")
|
||||
dockerCertPath = filepath.Join(getHomeDir(), ".docker")
|
||||
}
|
||||
}
|
||||
|
||||
func getHomeDir() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return os.Getenv("USERPROFILE")
|
||||
}
|
||||
return os.Getenv("HOME")
|
||||
}
|
||||
|
||||
var (
|
||||
flVersion = flag.Bool([]string{"v", "-version"}, false, "Print version information and quit")
|
||||
flDaemon = flag.Bool([]string{"d", "-daemon"}, false, "Enable daemon mode")
|
||||
|
|
Loading…
Add table
Reference in a new issue