-
Notifications
You must be signed in to change notification settings - Fork 32
fix: format env command section headers together as titles #461
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -126,6 +126,7 @@ func runEnvAddCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, arg | |||||
|
|
||||||
| // Add the environment variable using either the Slack API method or the | ||||||
| // project ".env" file depending on the app hosting. | ||||||
| var details []string | ||||||
| if hosted && !selection.App.IsDev { | ||||||
| err := clients.API().AddVariable( | ||||||
| ctx, | ||||||
|
|
@@ -137,14 +138,7 @@ func runEnvAddCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, arg | |||||
| if err != nil { | ||||||
| return err | ||||||
| } | ||||||
| clients.IO.PrintTrace(ctx, slacktrace.EnvAddSuccess) | ||||||
| clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{ | ||||||
| Emoji: "evergreen_tree", | ||||||
| Text: "App Environment", | ||||||
| Secondary: []string{ | ||||||
| fmt.Sprintf("Successfully added \"%s\" as an app environment variable", variableName), | ||||||
| }, | ||||||
| })) | ||||||
| details = append(details, fmt.Sprintf("Successfully added \"%s\" as an app environment variable", variableName)) | ||||||
| } else { | ||||||
| exists, err := afero.Exists(clients.Fs, ".env") | ||||||
| if err != nil { | ||||||
|
|
@@ -154,17 +148,17 @@ func runEnvAddCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, arg | |||||
| if err != nil { | ||||||
| return err | ||||||
| } | ||||||
| clients.IO.PrintTrace(ctx, slacktrace.EnvAddSuccess) | ||||||
| var details []string | ||||||
| if !exists { | ||||||
| details = append(details, "Created a project .env file that shouldn't be added to version control") | ||||||
| } | ||||||
| details = append(details, fmt.Sprintf("Successfully added \"%s\" as a project environment variable", variableName)) | ||||||
| clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{ | ||||||
| Emoji: "evergreen_tree", | ||||||
| Text: "App Environment", | ||||||
| Secondary: details, | ||||||
| })) | ||||||
| } | ||||||
|
|
||||||
| clients.IO.PrintTrace(ctx, slacktrace.EnvAddSuccess) | ||||||
| clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{ | ||||||
| Emoji: "evergreen_tree", | ||||||
| Text: "Environment Add", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Based on #460 what about?
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mwbrooks Haha I realize these branches overlap! Would we want to use:
Instead? I agree this reads odd but matching the command name might let use expand more in details that follow I hope 📚 |
||||||
| Secondary: details, | ||||||
| })) | ||||||
| return nil | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -107,7 +107,7 @@ func runEnvRemoveCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, | |||||
| clients.IO.PrintTrace(ctx, slacktrace.EnvRemoveSuccess) | ||||||
| clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{ | ||||||
| Emoji: "evergreen_tree", | ||||||
| Text: "App Environment", | ||||||
| Text: "Environment Remove", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
edit- Saw michaels suggestion above and I like "Unset environment variable"! |
||||||
| Secondary: []string{ | ||||||
| "The app has no environment variables to remove", | ||||||
| }, | ||||||
|
|
@@ -143,7 +143,7 @@ func runEnvRemoveCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, | |||||
| clients.IO.PrintTrace(ctx, slacktrace.EnvRemoveSuccess) | ||||||
| clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{ | ||||||
| Emoji: "evergreen_tree", | ||||||
| Text: "App Environment", | ||||||
| Text: "Environment Remove", | ||||||
| Secondary: []string{ | ||||||
| fmt.Sprintf( | ||||||
| "Successfully removed \"%s\" from the app's environment variables", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Should we start using the terms "set" and "unset" based on PR #460? While using another word like "added" might solidify what's happening, I think "set" is more accurate because it may be adding or updating the key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwbrooks @srtaalej Noted in #460 also that "remove" might have a few places to change! I agree with both comments and mirror this here to not forget 👾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧪 note: This will require updates to our E2E tests too!