]> granicus.if.org Git - neomutt/commitdiff
made minor updates for more flexibility
authorJoshua Jordi <JakkinStewart@users.noreply.github.com>
Mon, 22 Aug 2016 00:56:22 +0000 (19:56 -0500)
committerGitHub <noreply@github.com>
Mon, 22 Aug 2016 00:56:22 +0000 (19:56 -0500)
install.sh

index 216593888e21e30bdc144dfb07ac56f34c9b4597..5466d0415bb38c0a85cd65c3096a7a250e427169 100644 (file)
@@ -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