-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
guard against minimal environments #24
Conversation
reset=$(tput sgr0) | ||
else | ||
bold="" | ||
reset="" |
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.
I don't think the three lines above are necessary. Won't bold
and reset
default to empty string if not defined?
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.
Won't bold and reset default to empty string if not defined?
Yes, however, when running xyz
in gitbash, the script fails like so:
$ ./xyz --dry-run
./xyz: line 122: tput: command not found
With the guard above included, it works just fine:
$ ./xyz --dry-run
Current version is 0.5.0. Press [enter] to publish [email protected].
npm prune
npm test
node -e 'var o = require("./package.json"); o.version = "0.5.1"; require("fs").writeFileSync("./package.json", JSON.stringify(o, null, 2) + "\n");'
git add 'package.json'
git commit --message 'Version 0.5.1'
git tag --annotate 'v0.5.1' --message 'Version 0.5.1'
git push 'origin' 'refs/heads/master' 'refs/tags/v0.5.1'
npm publish
But you don't get the nice bolding of the version numbers.
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.
I'm not suggesting removing the guard. I'm suggesting that rather than…
if ... ; then
bold=$(tput bold)
reset=$(tput sgr0)
else
bold=""
reset=""
fi
we have…
if ... ; then
bold=$(tput bold)
reset=$(tput sgr0)
fi
((:bell:)) |
This looks great. I love how minimal the fix ended up being. One minor point: Your avatar is not being displayed because the email address you used is not associated with your GitHub account. Would you mind linking it? I'd like to see the dinosaur in the commit history. :) |
curious. is the avatar there now? |
Yes. Thanks. :) One more thing: Would you mind rebasing on master? |
🌳 |
Released in v1.0.1 |
ran into this in gitbash on an OS that must not be named