Skip to content

Commit

Permalink
Set AWS_PROFILE on export
Browse files Browse the repository at this point in the history
  • Loading branch information
diasjorge committed Oct 22, 2019
1 parent b55e2bf commit 2747fc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ func export(cmd *cobra.Command, args []string) error {
return errors.New("PROFILE required")
}

creds, err := credentials.Get(args[0], quiet)
profileName := args[0]

creds, err := credentials.Get(profileName, quiet)

if err != nil {
return err
}

fmt.Printf("export AWS_PROFILE='%s'\n", profileName)
fmt.Printf("export AWS_ACCESS_KEY_ID='%s'\n", creds.AccessKeyID)
fmt.Printf("export AWS_SECRET_ACCESS_KEY='%s'\n", creds.SecretAccessKey)
fmt.Printf("export AWS_SESSION_TOKEN='%s'\n", creds.SessionToken)
Expand Down

0 comments on commit 2747fc8

Please sign in to comment.