Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Change ParseConfigFile to use full path+file instead of just path
Browse files Browse the repository at this point in the history
  • Loading branch information
buzzsurfr committed Mar 4, 2020
1 parent 23c39bb commit 142f1a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloud/aws/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"os"
"os/exec"
"path/filepath"
"sort"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -112,7 +113,7 @@ func FromConfigFile(findDefault bool) (Profiles, error) {
}

// Parse AWS config file
profiles, err = parseConfigFile(awsConfigPath, findDefault)
profiles, err = parseConfigFile(filepath.Join(awsConfigPath, "credentials"), findDefault)
if err != nil {
return Profiles{}, err
}
Expand All @@ -127,9 +128,8 @@ func parseConfigFile(path string, findDefault bool) (Profiles, error) {
var profiles Profiles

v := viper.New()
v.SetConfigName("credentials")
v.SetConfigFile(path)
v.SetConfigType("ini")
v.AddConfigPath(path)
err := v.ReadInConfig()
if err != nil {
return profiles, err // Returning profiles since it's empty here
Expand Down

0 comments on commit 142f1a9

Please sign in to comment.