fixed vimrc backup

This commit is contained in:
2024-05-21 18:03:28 +00:00
parent 8aa062c0ad
commit f353b646a2
+2 -2
View File
@@ -445,9 +445,9 @@ VIM
curl --output "$HOME/.vim/autoload/plug.vim" --silent "https://raw.githubusercontent.com/junegunn/vim-plug/$version/plug.vim"
echo 'Installing vimrc'
if [ -f "${HOME}/.vimrc" ]; then
if [[ -f "$HOME/.vimrc" ]] && [[ ! -f "$HOME/vimrc.backup.$curdate" ]]; then
echo 'existing vimrc file detected, backing up'
mv "${HOME}/.vimrc" "${HOME}/.vimrc_`date +%s`"
mv "$HOME/.vimrc" "$HOME/vimrc.backup.$curdate"
fi
cp "${LOCATION}/vim/vimrc" "${HOME}/.vimrc"