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

cli: option to disable spinner via environment variable #1207

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

datosh
Copy link
Contributor

@datosh datosh commented Feb 16, 2023

Proposed change(s)

  • Option to disable spinner via CONSTELL_NO_SPINNER environment variable. Main motivation is to automatically skip waiting times in asciinema recordings
  • Fix constellation terminate spinner to honor debug flag and new CONSTELL_NO_SPINNER environment variable

Checklist

  • Update docs
  • Add labels (e.g., for changelog category)
  • Link to Milestone

@datosh datosh added the feature This introduces new functionality label Feb 16, 2023
@datosh datosh added this to the v2.6.0 milestone Feb 16, 2023
@netlify
Copy link

netlify bot commented Feb 16, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit a8428ad
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/63ee32572b21bc000762be5c

@@ -37,7 +37,10 @@ func NewTerminateCmd() *cobra.Command {
// runTerminate runs the terminate command.
func runTerminate(cmd *cobra.Command, args []string) error {
fileHandler := file.NewHandler(afero.NewOsFs())
spinner := newSpinner(cmd.ErrOrStderr())
spinner, err := newSpinnerOrStderr(cmd)
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove the newSpinner funciton so this cannot happen again? The code could just be inlined into the newSpinnerOrStderr function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked this. newSpinner is used quite a few times in spinner_test as well. Inlining this everywhere is probably not the right call.

The cleaner solution IMO would be to have spinner in its own package and export only required functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will refactor this in another PR.

@datosh datosh merged commit 5e7dc0d into main Feb 16, 2023
@datosh datosh deleted the feat/option-to-disable-spinner branch February 16, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This introduces new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants