-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4519 from RanVaknin/fix-home-dir
fix-resolve-home-v1
- Loading branch information
Showing
4 changed files
with
45 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
### SDK Features | ||
|
||
### SDK Enhancements | ||
* `aws/session`: Modified config resolution strategy when `$HOME` or `%USERPROFILE%` environment variables are not set. | ||
* When the environment variables are not set, the SDK will attempt to determine the home directory using `user.Current()`. | ||
|
||
### SDK Bugs |
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,18 @@ | ||
//go:build !go1.12 | ||
// +build !go1.12 | ||
|
||
package shareddefaults | ||
|
||
import ( | ||
"os" | ||
"runtime" | ||
) | ||
|
||
func userHomeDir() string { | ||
if runtime.GOOS == "windows" { // Windows | ||
return os.Getenv("USERPROFILE") | ||
} | ||
|
||
// *nix | ||
return os.Getenv("HOME") | ||
} |
13 changes: 13 additions & 0 deletions
13
internal/shareddefaults/shared_config_resolve_home_go1.12.go
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,13 @@ | ||
//go:build go1.12 | ||
// +build go1.12 | ||
|
||
package shareddefaults | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
func userHomeDir() string { | ||
home, _ := os.UserHomeDir() | ||
return home | ||
} |