From a3b94344f1b65f61ecbef625b8378636692704c5 Mon Sep 17 00:00:00 2001 From: Joshua Jordi Date: Sun, 21 Aug 2016 19:56:22 -0500 Subject: [PATCH] made minor updates for more flexibility --- install.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/install.sh b/install.sh index 216593888..5466d0415 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#! /usr/bin/bash +#!/bin/sh # If no directory exists, make it exist. if [ -d "$HOME/.mutt/keybaseMutt" ]; then @@ -7,13 +7,13 @@ if [ -d "$HOME/.mutt/keybaseMutt" ]; then if [ -d "$HOME/.mutt/keybaseMuttBACKUP" ]; then #echo "$HOME/.mutt/keybaseMuttBACKUP exists" echo "You are going to overwrite your backup. Are you sure you want to do this? [y|n]" - read overwrite + read -r overwrite # If they want to delete their backup. - if [ $overwrite == 'y' ]; then - cp -R $HOME/.mutt/keybaseMutt $HOME/.mutt/keybaseMuttBACKUP - rm -r $HOME/.mutt/keybaseMutt - mkdir -p $HOME/.mutt/keybaseMutt/scripts + if [ "$overwrite" = 'y' ]; then + cp -R "$HOME/.mutt/keybaseMutt" "$HOME/.mutt/keybaseMuttBACKUP" + rm -r "$HOME/.mutt/keybaseMutt" + mkdir -p "$HOME/.mutt/keybaseMutt/scripts" # Otherwise, abort mission. else @@ -23,35 +23,35 @@ if [ -d "$HOME/.mutt/keybaseMutt" ]; then elif [ ! -d "$HOME/.mutt/keybaseMuttBACKUP" ]; then echo "Backing up previous install." - cp -R $HOME/.mutt/keybaseMutt $HOME/.mutt/keybaseMuttBACKUP - rm -r $HOME/.mutt/keybaseMutt - mkdir -p $HOME/.mutt/keybaseMutt/scripts + cp -R "$HOME/.mutt/keybaseMutt" "$HOME/.mutt/keybaseMuttBACKUP" + rm -r "$HOME/.mutt/keybaseMutt" + mkdir -p "$HOME/.mutt/keybaseMutt/scripts" fi # Otherwise, make a backup elif [ ! -d "$HOME/.mutt/keybaseMutt" ]; then echo "Installing your program..." - mkdir -p $HOME/.mutt/keybaseMutt/scripts + mkdir -p "$HOME/.mutt/keybaseMutt/scripts" fi # Copy my directory to your directory. -cp ./keybase.py $HOME/.mutt/keybaseMutt -cp ./pgpdecrypt.sh $HOME/.mutt/keybaseMutt/scripts -cp ./decrypt.sh $HOME/.mutt/keybaseMutt/scripts -cp ./verify.sh $HOME/.mutt/keybaseMutt/scripts -cp ./pgpverify.sh $HOME/.mutt/keybaseMutt/scripts +cp ./keybase.py "$HOME/.mutt/keybaseMutt" +cp ./pgpdecrypt.sh "$HOME/.mutt/keybaseMutt/scripts" +cp ./decrypt.sh "$HOME/.mutt/keybaseMutt/scripts" +cp ./verify.sh "$HOME/.mutt/keybaseMutt/scripts" +cp ./pgpverify.sh "$HOME/.mutt/keybaseMutt/scripts" # Yay! Stuff's installed! -echo "You'll need to include a path to '~/.mutt/keybase/scripts' in your shell's rc file. If you've done this previously on your computer, press 'n'." +echo "You'll need to include a path to '~/.mutt/keybaseMutt/scripts' in your shell's rc file. If you've done this previously on your computer, press 'n'." echo "Do you use [b]ash, [k]sh, or [z]sh? [n]" echo "(You use $SHELL)" -read shellInput -if [ $shellInput == 'b' ]; then - echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> $HOME/.bashrc -elif [ $shellInput == 'k' ]; then - echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> $HOME/.kshrc -elif [ $shellInput == 'z' ]; then - echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> $HOME/.zshrc +read -r shellInput +if [ "$shellInput" = 'b' ]; then + echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> "$HOME/.bashrc" +elif [ "$shellInput" = 'k' ]; then + echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> "$HOME/.kshrc" +elif [ "$shellInput" = 'z' ]; then + echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> "$HOME/.zshrc" else echo "If you use something another shell, you'll need to add the path manually." fi -- 2.49.0