Created
May 18, 2020 15:17
-
-
Save LeFnord/1100fc2b6839de97ba5c1141c8fee869 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# since ruby 2.7.1 is out, also a bunch of deprecation warnings pos up, | |
# this makes sense, but in day-to-day it is annoying | |
# | |
# this snippet is then be loaded on my .zshrc and sets the stuff dependeing on ruby version | |
#!/usr/bin/env sh | |
set -e | |
command="ruby -v" | |
ruby_version=$(eval "$command") | |
if [[ "$ruby_version" == "ruby 2.6"* ]]; then | |
echo $ruby_version | |
# this exists only to ensure all is fine | |
unset RUBYOPT | |
elif [[ "$ruby_version" == "ruby 2.7"* ]]; then | |
echo $ruby_version | |
export RUBYOPT='-W:no-deprecated -W:no-experimental' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment