Merge pull request #7166 from hashicorp/fix_7160
windows plugin: prioritize AppData over default user directory ( UserProfile )
This commit is contained in:
commit
532dd5fed9
|
@ -44,12 +44,17 @@ func ConfigTmpDir() (string, error) {
|
|||
|
||||
func homeDir() (string, error) {
|
||||
|
||||
// First prefer the HOME environmental variable
|
||||
// Prefer $HOME over user.Current due to glibc bug: golang.org/issue/13470
|
||||
if home := os.Getenv("HOME"); home != "" {
|
||||
log.Printf("Detected home directory from env var: %s", home)
|
||||
return home, nil
|
||||
}
|
||||
|
||||
if home := os.Getenv("APPDATA"); home != "" {
|
||||
log.Printf("Detected home directory from env var: %s", home)
|
||||
return home, nil
|
||||
}
|
||||
|
||||
// Fall back to the passwd database if not found which follows
|
||||
// the same semantics as bourne shell
|
||||
u, err := user.Current()
|
||||
|
|
|
@ -52,10 +52,13 @@ later, it will take precedence over one found earlier.
|
|||
|
||||
1. The directory where `packer` is, or the executable directory.
|
||||
|
||||
2. `~/.packer.d/plugins` on Unix systems or `%APPDATA%/packer.d/plugins` on
|
||||
Windows.
|
||||
2. The `$HOME/packer.d/plugins` directory, if `$HOME` is defined (unix)
|
||||
|
||||
3. The current working directory.
|
||||
3. The `%APPDATA%/packer.d/plugins` if `%APPDATA%` is defined (windows)
|
||||
|
||||
4. The `%USERPROFILE%/packer.d/plugins` if `%USERPROFILE%` is defined (windows)
|
||||
|
||||
4. The current working directory.
|
||||
|
||||
The valid types for plugins are:
|
||||
|
||||
|
|
Loading…
Reference in New Issue