We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents aeab895 + 5606b4c commit 93f86c4Copy full SHA for 93f86c4
main.go
@@ -35,7 +35,12 @@ func main() {
35
36
// Get credentials
37
usr, _ := user.Current()
38
- credentialsPath := fmt.Sprintf("%s/.aws/credentials", usr.HomeDir)
+
39
+ credentialsPath := os.Getenv("AWS_SHARED_CREDENTIALS_FILE")
40
+ if len(credentialsPath) == 0 {
41
+ credentialsPath = fmt.Sprintf("%s/.aws/credentials", usr.HomeDir)
42
+ }
43
44
credentialsProvider := credentials.NewSharedCredentials(credentialsPath, profileFlag)
45
creds, err := credentialsProvider.Get()
46
check(err)
0 commit comments