Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Generate = &cli.Command{ Name: "generate", Usage: "Generate AWS config", Flags: []cli.Flag{ &cli.StringFlag{ Name: "ssoURL", Aliases: []string{"s"}, Usage: "AWS Single Sign On URL", Required: true, }, &cli.StringFlag{ Name: "region", Aliases: []string{"r"}, Usage: "AWS Region used by SSO", }, }, Action: func(c *cli.Context) error { ssoURL := c.String("ssoURL") region := c.String("region") if c.String("region") == "" { region = "us-east-1" } configDir := configDirName() configFile := filepath.Join(configDir, "config") if !fileExists(configFile) { createPath(configDir) generateConfig(ssoURL, region) } else { // config already exists, check if the user wants to overwrite var selectedOption string fmt.Print("Overwrite current config(~/.aws/config)[y/N]? ") _, err := fmt.Scanf("%s", &selectedOption) if err != nil { fmt.Println("Default option") } if selectedOption == "y" || selectedOption == "Y" { generateConfig(ssoURL, region) } else { printConfig(ssoURL, region) } } return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.