diff options
author | kylo252 <[email protected]> | 2021-12-09 11:51:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-09 11:51:37 +0100 |
commit | 68cdb62f87543d5420e70c241ebd5942ed9c7b0e (patch) | |
tree | a6240d9d7a138a3f5d72614759bdbfdd8305a53b /utils/installer/install.sh | |
parent | c43ee9aa3a6353e74d577cb79e60c5c885bc02f5 (diff) |
fix(bootstrap): remove hard-coded spellfile option (#2061)
Diffstat (limited to 'utils/installer/install.sh')
-rwxr-xr-x | utils/installer/install.sh | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/utils/installer/install.sh b/utils/installer/install.sh index 88c3e550..722144e3 100755 --- a/utils/installer/install.sh +++ b/utils/installer/install.sh @@ -107,11 +107,7 @@ function main() { msg "Backing up old LunarVim configuration" backup_old_config - if [ "$ARGS_OVERWRITE" -eq 1 ]; then - for dir in "${__lvim_dirs[@]}"; do - [ -d "$dir" ] && rm -rf "$dir" - done - fi + verify_lvim_dirs if [ -e "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" ]; then update_lvim @@ -262,11 +258,24 @@ function install_rust_deps() { echo "All Rust dependencies are successfully installed" } +function verify_lvim_dirs() { + if [ "$ARGS_OVERWRITE" -eq 1 ]; then + for dir in "${__lvim_dirs[@]}"; do + [ -d "$dir" ] && rm -rf "$dir" + done + fi + + for dir in "${__lvim_dirs[@]}"; do + mkdir -p "$dir" + done +} + function backup_old_config() { for dir in "${__lvim_dirs[@]}"; do - # we create an empty folder for subsequent commands \ - # that require an existing directory - mkdir -p "$dir" "$dir.bak" + if [ ! -d "$dir" ]; then + continue + fi + mkdir -p "$dir.bak" touch "$dir/ignore" if command -v rsync &>/dev/null; then rsync --archive -hh --partial --progress --cvs-exclude \ @@ -307,7 +316,6 @@ function link_local_lvim() { rm -rf "$LUNARVIM_RUNTIME_DIR/lvim" fi - mkdir -p "$LUNARVIM_RUNTIME_DIR" echo " - $BASEDIR -> $LUNARVIM_RUNTIME_DIR/lvim" ln -s -f "$BASEDIR" "$LUNARVIM_RUNTIME_DIR/lvim" } |