Skip to content

Beautify the terminal output#13

Open
dh-nunes wants to merge 1 commit intorhysd:masterfrom
dh-nunes:beautify
Open

Beautify the terminal output#13
dh-nunes wants to merge 1 commit intorhysd:masterfrom
dh-nunes:beautify

Conversation

@dh-nunes
Copy link
Copy Markdown

  • Adds some colour to the hook prints (adds colored as a build dependency)
  • Command output is only shown in case of failure
  • Little spinner tacked onto the end so we know when the hook hangs

@dh-nunes dh-nunes marked this pull request as ready for review September 28, 2019 03:00
Copy link
Copy Markdown
Owner

@rhysd rhysd left a comment

Choose a reason for hiding this comment

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

Basically good 👍 except for animation. Would you take a look at my comment?

sp=${{sp#?}}${{sp%???}}
sleep 0.1
done
}}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't think animation is helpful for users since users since users already know what script is being run. And animation may cause some junks on some terminals. I want to choose keeping generated script simple here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I would argue the animation is essential since it shows the process isn't hung - some of those commands can take a looong time to finish. The actual animation doesn't really matter I just added the simplest I could find. As for the terminals, it should all be posix compliant which should make it fine with linux terminals and I've tested on windows with Git Bash, Powershell and good old cmd and they all show it just fine. Still, keyword is 'should'.

Copy link
Copy Markdown
Owner

@rhysd rhysd Nov 3, 2019

Choose a reason for hiding this comment

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

I would argue the animation is essential since it shows the process isn't hung

Good point which I didn't care. I'm not understanding why user can know the process is not hung here. For example, let's say cargo test run by hook script hangs. Then the spinner will keep showing the animation. Rather than capturing output for spin animation, showing the log directly looks better way for me. cargo test shows output for each test case execution. So user can know test is still going ahead or is stuck at some test case. I think original husky does not hide output from underlying commands execution for check.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ohh right, for me showing everything just looked too cluttered :P Is there anything you want to keep from this pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants