From 744cae46d6f259d2076218df34a4f9648141ce69 Mon Sep 17 00:00:00 2001 From: Willa Drengwitz Date: Fri, 31 Aug 2018 07:29:44 -0400 Subject: [PATCH] Fix uninstall for osx --- uninstall.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 0805a6e..f91235a 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,7 +1,15 @@ #!/bin/sh # uninstall by (github: bernardofire) # Remove line from bashrc and zshrc if present. + +sed="sed -i" +if [[ $OSTYPE == "Darwin" ]]; then + sed="sed -i ''" +fi + for rc in bashrc zshrc; do - sed -i '/scm_breeze/d' "$HOME/.$rc" - printf "Removed SCM Breeze from %s\n" "$HOME/.$rc" + if [ -f "$HOME/.$rc" ]; then + $sed '/scm_breeze/d' "$HOME/.$rc" && + printf "Removed SCM Breeze from %s\n" "$HOME/.$rc" + fi done