-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating default config and cache directory for unix systems
- Loading branch information
Showing
7 changed files
with
66 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// +build darwin freebsd linux netbsd openbsd solaris | ||
|
||
package packer | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
func getDefaultCacheDir() string { | ||
var defaultConfigFileDir string | ||
|
||
if xdgConfigHome := os.Getenv("XDG_CONFIG_HOME"); xdgConfigHome != "" { | ||
defaultConfigFileDir = xdgConfigHome | ||
} else { | ||
defaultConfigFileDir = filepath.Join(os.Getenv("HOME"), "cache") | ||
} | ||
|
||
return filepath.Join(defaultConfigFileDir, "packer") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// +build windows | ||
|
||
package packer | ||
|
||
const ( | ||
defaultConfigFile = "packer_cache" | ||
) | ||
|
||
func getDefaultCacheDir() string { | ||
return defaultConfigFile | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters