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

detail: Switch to inverting the cmd to run instead of quoting #8

Merged
merged 3 commits into from
Apr 30, 2018

Conversation

iarna
Copy link
Contributor

@iarna iarna commented Apr 29, 2018

The idea here is that this way double clicking the command to run will never pick up backticks. It's also substantially more visible.

I swapped from ansicolors to my own console-control-strings for this to get the invert codes.

I ah, also ended up rewriting lib/utils.jsl a bit. 😅🙏

Anyway, this is what it looks like (in Terminal and iTerm2):

updated

@coveralls
Copy link

coveralls commented Apr 29, 2018

Pull Request Test Coverage Report for Build 17

  • 10 of 10 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9: 0.0%
Covered Lines: 133
Relevant Lines: 133

💛 - Coveralls

The idea here is that this way double clicking the command to run will never
pick up backticks. It's also substantially more visible.

I swapped from `ansicolors` to my own `console-control-strings` for this to
get the invert codes.
I…  didn't notice this was already imported when I switched to
console-control-strings. It woulda done the job… but it's not actually used anyway.
@@ -92,7 +92,7 @@ const report = function (data, options) {
if (action.action === 'update' || action.action === 'install') {
const recommendation = getRecommendation(action, config)
const label = action.resolves.length === 1 ? 'vulnerability' : 'vulnerabilities'
log(`\n\n# Run \`${Utils.color(recommendation.cmd, 'red', config.withColor)}\` to resolve ${action.resolves.length} ${label}`)
log(`\n\n# Run ${Utils.color(' ' + recommendation.cmd + ' ', 'inverse', config.withColor)} to resolve ${action.resolves.length} ${label}`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When this was red, it was Utils.color(…, ['red', 'inverse'], configWithColor). (The console-control-strings color function can combine multiple color codes efficiently.)

Worth noting here is the added spacing around the command.

@evilpacket evilpacket merged commit 5adc822 into master Apr 30, 2018
@evilpacket evilpacket deleted the change-code-presentation branch April 30, 2018 15:30
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.

None yet

3 participants