From ebbea8d4512c0a4060d7535eaf702023c508f0a8 Mon Sep 17 00:00:00 2001 From: pvincent Date: Mon, 29 Apr 2024 21:24:03 +0400 Subject: [PATCH] fix --- init.sh | 2 +- install.sh | 2 +- uninstall.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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"