Skip to content

Commit

Permalink
Merge pull request #5 from serokell/master
Browse files Browse the repository at this point in the history
Default to AWS_SHARED_CREDENTIALS_FILE
  • Loading branch information
boroivanov authored Sep 28, 2018
2 parents aeab895 + 5606b4c commit 93f86c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ func main() {

// Get credentials
usr, _ := user.Current()
credentialsPath := fmt.Sprintf("%s/.aws/credentials", usr.HomeDir)

credentialsPath := os.Getenv("AWS_SHARED_CREDENTIALS_FILE")
if len(credentialsPath) == 0 {
credentialsPath = fmt.Sprintf("%s/.aws/credentials", usr.HomeDir)
}

credentialsProvider := credentials.NewSharedCredentials(credentialsPath, profileFlag)
creds, err := credentialsProvider.Get()
check(err)
Expand Down

0 comments on commit 93f86c4

Please sign in to comment.