summaryrefslogtreecommitdiff
path: root/utils/installer/install.sh
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-03-10 09:54:38 +0100
committerGitHub <[email protected]>2022-03-10 09:54:38 +0100
commit4c705bc07d7e0510e88d9ce95e45999e95719144 (patch)
treef1b37c9749c551fb755218a028159dbfe0da3597 /utils/installer/install.sh
parent637658ae2c4ae6acd2179ea5ce7a482e557944f2 (diff)
feat(windows): add custom config_win.example.lua (#2330)
Diffstat (limited to 'utils/installer/install.sh')
-rwxr-xr-xutils/installer/install.sh47
1 files changed, 23 insertions, 24 deletions
diff --git a/utils/installer/install.sh b/utils/installer/install.sh
index 803b94dd..6aca4ca9 100755
--- a/utils/installer/install.sh
+++ b/utils/installer/install.sh
@@ -321,30 +321,29 @@ function verify_lvim_dirs() {
}
function backup_old_config() {
- for dir in "${__lvim_dirs[@]}"; do
- if [ ! -d "$dir" ]; then
- continue
- fi
- mkdir -p "$dir.bak"
- touch "$dir/ignore"
- msg "Backing up old $dir to $dir.bak"
- if command -v rsync &>/dev/null; then
- rsync --archive -hh --stats --partial --copy-links --cvs-exclude "$dir"/ "$dir.bak"
- else
- OS="$(uname -s)"
- case "$OS" in
- Linux | *BSD)
- cp -r "$dir/"* "$dir.bak/."
- ;;
- Darwin)
- cp -R "$dir/"* "$dir.bak/."
- ;;
- *)
- echo "OS $OS is not currently supported."
- ;;
- esac
- fi
- done
+ local src="$LUNARVIM_CONFIG_DIR"
+ if [ ! -d "$dir" ]; then
+ return
+ fi
+ mkdir -p "$src.old"
+ touch "$src/ignore"
+ msg "Backing up old $src to $src.old"
+ if command -v rsync &>/dev/null; then
+ rsync --archive -hh --stats --partial --copy-links --cvs-exclude "$src"/ "$src.old"
+ else
+ OS="$(uname -s)"
+ case "$OS" in
+ Linux | *BSD)
+ cp -r "$src/"* "$src.old/."
+ ;;
+ Darwin)
+ cp -R "$src/"* "$src.old/."
+ ;;
+ *)
+ echo "OS $OS is not currently supported."
+ ;;
+ esac
+ fi
msg "Backup operation complete"
}