fixed bug with storage-path

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2015-03-19 23:19:13 -04:00
parent 5a86bad5fe
commit fe912ae55a
No known key found for this signature in database
GPG Key ID: A519480096146526
2 changed files with 9 additions and 5 deletions

View File

@ -39,7 +39,7 @@ func main() {
cli.StringFlag{
EnvVar: "MACHINE_STORAGE_PATH",
Name: "storage-path",
Value: utils.GetBaseDir(),
Value: utils.GetMachineRoot(),
Usage: "Configures storage path",
},
cli.StringFlag{

View File

@ -22,7 +22,7 @@ func GetHomeDir() string {
func GetBaseDir() string {
baseDir := os.Getenv("MACHINE_STORAGE_PATH")
if baseDir == "" {
baseDir = filepath.Join(GetHomeDir(), ".docker", "machine")
baseDir = filepath.Join(GetHomeDir(), ".docker")
}
return baseDir
}
@ -31,16 +31,20 @@ func GetDockerDir() string {
return filepath.Join(GetHomeDir(), ".docker")
}
func GetMachineRoot() string {
return filepath.Join(GetBaseDir(), "machine")
}
func GetMachineDir() string {
return filepath.Join(GetBaseDir(), "machines")
return filepath.Join(GetMachineRoot(), "machines")
}
func GetMachineCertDir() string {
return filepath.Join(GetBaseDir(), "certs")
return filepath.Join(GetMachineRoot(), "certs")
}
func GetMachineCacheDir() string {
return filepath.Join(GetBaseDir(), "cache")
return filepath.Join(GetMachineRoot(), "cache")
}
func GetUsername() string {