dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 8e6c99c79970ff31be7ef95a8defb9a6931865ac
parent 6351975b2b2ac58bfcc2da0280d96c1221444295
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Mon, 18 Dec 2017 10:47:50 -0500

Automatically (re)install ruby and gems

Diffstat:
Mlinks/bin/t-followers-diff.sh | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/links/bin/t-followers-diff.sh b/links/bin/t-followers-diff.sh @@ -2,6 +2,29 @@ # https://github.com/sferik/t +# test if t is available and working correctly +t help >/dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "t not working. Trying to (re)install ruby and gems" + + rm -rf /usr/local/lib/ruby/gems/ + brew uninstall ruby --ignore-dependencies + brew install ruby + brew link --overwrite ruby + + command -v gem >/dev/null 2>&1 || \ + { (>&2 echo "ERROR: gem command not available. Bye."); exit 1; } + + gem update + gem install t + + t help >/dev/null 2>&1 + if [ $? -ne 0 ]; then + (>&2 echo "ERROR: t still not working. Bye.") + exit 1 + fi +fi + tmpfile=~/tmp/t-followers.txt mv $tmpfile{,-old}