This repository has been archived by the owner on Mar 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f307aa6
commit 95c32a7
Showing
24 changed files
with
474 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package env | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/bharath-srinivas/aws-go/store" | ||
) | ||
|
||
// env create command. | ||
var createCmd = &cobra.Command{ | ||
Use: "create", | ||
Short: "Create a new AWS profile with specified region (if provided)", | ||
Example: " aws-go env create --profile staging --region us-west-1", | ||
Run: createEnv, | ||
} | ||
|
||
// env create run command. | ||
func createEnv(cmd *cobra.Command, args []string) { | ||
if store.Profile == "" { | ||
cmd.Usage() | ||
os.Exit(0) | ||
} | ||
store.SetCredentials() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package env | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/bharath-srinivas/aws-go/store" | ||
) | ||
|
||
// env use command. | ||
var useCmd = &cobra.Command{ | ||
Use: "use", | ||
Short: "Use the specified AWS profile and region (if provided)", | ||
Example: " aws-go env use --profile staging --region eu-west-1", | ||
Run: useEnv, | ||
} | ||
|
||
// env use run command. | ||
func useEnv(cmd *cobra.Command, args []string) { | ||
if store.Profile == "" { | ||
cmd.Usage() | ||
os.Exit(0) | ||
} | ||
store.UseProfile() | ||
} |
Oops, something went wrong.