mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
Fix backup logic
This commit is contained in:
parent
55c6db1b12
commit
9228327f93
|
@ -88,7 +88,7 @@ installZoxide() {
|
|||
|
||||
linkConfig() {
|
||||
OLD_BASHRC="$HOME/.bashrc"
|
||||
if [ -e "$OLD_BASHRC" ]; then
|
||||
if [ -e "$OLD_BASHRC" ] && [ ! -e "$HOME/.bashrc.bak" ]; then
|
||||
printf "%b\n" "${YELLOW}Moving old bash config file to $HOME/.bashrc.bak${RC}"
|
||||
if ! mv "$OLD_BASHRC" "$HOME/.bashrc.bak"; then
|
||||
printf "%b\n" "${RED}Can't move the old bash config file!${RC}"
|
||||
|
@ -105,7 +105,7 @@ linkConfig() {
|
|||
printf "%b\n" "${RED}Failed to create symbolic link for starship.toml${RC}"
|
||||
exit 1
|
||||
}
|
||||
printf "%b\n" "${GREEN}Done!\nrestart your shell to see the changes.${RC}"
|
||||
printf "%b\n" "${GREEN}Done! restart your shell to see the changes.${RC}"
|
||||
}
|
||||
|
||||
checkEnv
|
||||
|
|
|
@ -36,7 +36,9 @@ setupNeovim() {
|
|||
}
|
||||
|
||||
backupNeovimConfig() {
|
||||
[ -d "$HOME/.config/nvim" ] && cp -r "$HOME/.config/nvim" "$HOME/.config/nvim-backup"
|
||||
if [ -d "$HOME/.config/nvim" ] && [ ! -d "$HOME/.config/nvim-backup" ]; then
|
||||
cp -r "$HOME/.config/nvim" "$HOME/.config/nvim-backup"
|
||||
fi
|
||||
rm -rf "$HOME/.config/nvim"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user