mrowa44 / emojify

Emoji on the command line :scream:
MIT License
1.55k stars 70 forks source link

🐛 Fix bash version check #51

Closed louib closed 4 years ago

louib commented 4 years ago

Hey @mrowa44 :wave:

The bash version check was performed after declaring the emoji array, so an error message was displayed by bash before printing the custom error message. I also changed the exit code to 1 (error) in the case of an old bash version.

Output before:

$ ../bash-3.2.57/bash emojify
emojify: line 28: :100:: syntax error: operand expected (error token is ":100:")
Oh my! That’s a very old version of bash you’re using, we don’t support that anymore :(

Consider upgrading it or, if you must use bash 3.2.57(1)-release download an old version of emojify from here: https://github.com/mrowa44/emojify/blob/old_bash_support/emojify

Output after:

$ ../bash-3.2.57/bash emojify
Oh my! That’s a very old version of bash you’re using, we don’t support that anymore :(
Consider upgrading it or, if you must use bash 3.2.57(1)-release, download an old version of
emojify from here: https://github.com/mrowa44/emojify/blob/old_bash_support/emojify

Thanks for reviewing :smile:

GrenderG commented 4 years ago

Makes sense, thanks!