Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
joanbono committed Mar 11, 2021
1 parent 1a7dfa7 commit 9a51f6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/rotate/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func CheckIAMErr(err error, profile, username string) {
fmt.Printf("%v Unknown error %v\n", red.Sprintf("[-]"), bold.Sprintf(`¯\_(ツ)_/¯`))
default:
if aerr.Error()[:21] == "NoCredentialProviders" {
fmt.Printf("[-] Profile %s not found\n", profile)
fmt.Printf("%v Profile %v not found\n", red.Sprintf("[-]"), bold.Sprintf(profile))
} else if aerr.Error()[:12] == "AccessDenied" {
if username == "" {
username = GetUsername(profile)
Expand All @@ -156,7 +156,7 @@ func CheckIAMErr(err error, profile, username string) {
} else {
fmt.Printf("%v Generic error: %v\n", red.Sprintf("[-]"), err.Error())
}
os.Exit(1)
os.Exit(3)
}

}
5 changes: 4 additions & 1 deletion modules/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func Reader() string {
//keys and replace them with the new ones
func UpdateCredentials(awsCredentials, oldKey, newKey string) {
read, err := ioutil.ReadFile(awsCredentials)
CheckErr(err)
if err != nil {
fmt.Printf("%v Error reading %v\n", red.Sprintf("[-]"), bold.Sprintf(awsCredentials))
os.Exit(2)
}

newKeys := strings.Replace(string(read), oldKey, newKey, -1)

Expand Down

0 comments on commit 9a51f6d

Please sign in to comment.