From e1c8dde88b64d047de03eaed43cc9bb025162ef9 Mon Sep 17 00:00:00 2001 From: Jon-William Lewis Date: Tue, 16 Feb 2016 11:04:27 -0600 Subject: [PATCH] Made install.sh not afraid to overwrite SNS. --- install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/install.sh b/install.sh index 588e874..a08f55c 100755 --- a/install.sh +++ b/install.sh @@ -47,9 +47,23 @@ chmod +x "$S" # Install SNS if [ ! -r "/bin/sns" ]; then sudo cp "$S" "/bin/sns" +else + if [ -r "/bin/sns" ]; then + if grep "simple note system" "/bin/sns"; then + sudo rm /bin/sns + sudo cp "$S" "/bin/sns" + fi + fi fi # Install Bash completion if [ ! -r "/usr/share/bash-completion/completions/sns" ]; then sudo cp "src/bash-completion/sns" "/usr/share/bash-completion/completions/sns" +else + if [ -r "/usr/share/bash-completion/completions/sns" ]; then + if grep "simple note system" "/usr/share/bash-completion/completions/sns"; then + sudo rm /bin/sns + sudo cp "$S" "/bin/sns" + fi + fi fi exit