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 --- README.md | 7 +++++++ install.sh | 27 +++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ccf2c92..c530b98 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,13 @@ the install.sh script and clone the config inside ~/.vim** git clone https://git.arka.rocks/vimrc.git ~/.vim ``` +*If you want to run the install script which will sed ~/.config/vim to ~/.vim +withtout copying the data into ~/.vim, you can run it with any argument you +want.* +```sh +./install.sh any_argument_you_want +``` + ## Plugins This config has just the necessary plugins installed: 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