diff --git a/init.sh b/init.sh index 87660de..7456843 100755 --- a/init.sh +++ b/init.sh @@ -15,7 +15,7 @@ readonly ORIGINAL="ORIGINAL" declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) for i in "${arr[@]}"; do - if [ ! -f "$i.$ORIGINAL" ]; then + if [[ -f "$i" ]] && [[ ! -f "$i.$ORIGINAL" ]]; then mv "$i" "$i.$ORIGINAL" basefile=$(basename "$i") ln -s "$MIAOU_BASH_DIR/$basefile" "$i" diff --git a/install.sh b/install.sh index 00eb1e6..678f222 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ ## CONSTANTS readonly CURDIR=$PWD -readonly REQUIRED_PKGS=(file git bc) +readonly REQUIRED_PKGS=(file git bc vim) readonly MAIN_TAR_GZ_URL="https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz" ## FUNCTIONS diff --git a/uninstall.sh b/uninstall.sh index c035911..6bd964e 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -9,7 +9,7 @@ ORIGINAL="ORIGINAL" declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) for i in "${arr[@]}"; do - if [ -f "$i.$ORIGINAL" ]; then + if [[ -f "$i" ]] && [[ -f "$i.$ORIGINAL" ]]; then echo "uninstalling $i" rm "$i" mv "$i.$ORIGINAL" "$i"