From f05d2056c1827fa520658b2244bf4c0991b6f7d7 Mon Sep 17 00:00:00 2001 From: Oxbian Date: Sun, 7 Sep 2025 11:34:11 +0200 Subject: feat: no copy with argument in install.sh --- install.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 5691fc4..2bb99ac 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh # POSIX script for setting up VIM -set -euo pipefail +set -eux # Variables script_name="$(basename "${0}")" @@ -25,17 +25,20 @@ clean_exit() { trap clean_exit EXIT -# Ask if user want to copy the project in ~/.vim -printf "${title}Do you want to copy VIM config in ~/.vim ? [N/y]${reset}\n" -read -r choice -case "$choice" in - y|Y) - cp -r . ~/.vim - printf "${green}%s${reset}\n" "VIM config copied in ~/.vim" - ;; - *) - ;; -esac +# Ask if user want to copy the project in ~/.vim, can be skipped by adding +# ./install.sh any_argument_you_want +if [ "$#" -eq 0 ]; then + printf "${title}Do you want to copy VIM config in ~/.vim ? [N/y]${reset}\n" + read -r choice + case "$choice" in + y|Y) + cp -r . ~/.vim + printf "${green}%s${reset}\n" "VIM config copied in ~/.vim" + ;; + *) + ;; + esac +fi sed -i s#\.config\/vim#\.vim## ~/.vim/conf/plugins.vim sed -i s#\.config\/vim#\.vim## ~/.vim/vimrc -- cgit v1.2.3