Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix env command message and rename "wiki" to "docs" cmd #955

Merged
merged 1 commit into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/copilot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func buildRootCmd() *cobra.Command {
// NOTE: Order for each grouping below is significant in that it affects help menu output ordering.
// "Getting Started" command group.
cmd.AddCommand(cli.BuildInitCmd())
cmd.AddCommand(cli.BuildWikiCmd())
cmd.AddCommand(cli.BuildDocsCmd())

// "Develop" command group.
cmd.AddCommand(cli.BuildAppCmd())
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/cli/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ func BuildEnvCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "env",
Short: `Commands for environments.
Environments are deployment stages with shared between services.`,
Environments are deployment stages shared between services.`,
Long: `Commands for environments.
Environments are deployment stages with shared between services.`,
Environments are deployment stages shared between services.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

}
// The flags bound by viper are available to all sub-commands through viper.GetString({flagName})
cmd.PersistentFlags().StringP(appFlag, appFlagShort, "" /* default */, appFlagDescription)
Expand Down
20 changes: 10 additions & 10 deletions internal/pkg/cli/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ import (
)

const (
wikiURL = "https://github.com/aws/amazon-ecs-cli-v2/wiki"
docsURL = "https://github.com/aws/amazon-ecs-cli-v2/wiki"
)

// BuildWikiCmd builds the command for opening the wiki.
func BuildWikiCmd() *cobra.Command {
// BuildDocsCmd builds the command for opening the documentation.
func BuildDocsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "wiki",
Short: "Open the project wiki.",
Long: "Open the project wiki.",
Use: "docs",
Short: "Open the copilot docs.",
Long: "Open the copilot docs.",
RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
var err error

switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", wikiURL).Start()
err = exec.Command("xdg-open", docsURL).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", wikiURL).Start()
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", docsURL).Start()
case "darwin":
err = exec.Command("open", wikiURL).Start()
err = exec.Command("open", docsURL).Start()
default:
err = fmt.Errorf("unsupported platform")
}
if err != nil {
return fmt.Errorf("open wiki: %w", err)
return fmt.Errorf("open docs: %w", err)
}

return nil
Expand Down