|
@@ -42,21 +42,25 @@ overwrite_local() { |
|
|
return 1; |
|
|
return 1; |
|
|
fi |
|
|
fi |
|
|
case "$1" in |
|
|
case "$1" in |
|
|
configs) cp -r "$BACKUPS_PATH/$1/$2" "$XDG_CONFIG_HOME/";; |
|
|
|
|
|
macros) cp -r "$BACKUPS_PATH/$1/$2" "$HOME/Macros/";; |
|
|
|
|
|
|
|
|
configs) cp -r $BACKUPS_PATH/$1/$2 "$XDG_CONFIG_HOME/";; |
|
|
|
|
|
macros) cp -r $BACKUPS_PATH/$1/$2 "$HOME/Macros/";; |
|
|
*) invalid_path_msg "$1"; return 1;; |
|
|
*) invalid_path_msg "$1"; return 1;; |
|
|
esac |
|
|
esac |
|
|
printf "local overwrite successful\n" |
|
|
printf "local overwrite successful\n" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
overwrite_lmacros() { |
|
|
|
|
|
overwrite_local macros '*' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
overwrite_backup() { |
|
|
overwrite_backup() { |
|
|
if [ git diff --stat $BACKUPS_PATH/$1 ]; then |
|
|
if [ git diff --stat $BACKUPS_PATH/$1 ]; then |
|
|
printf "There are uncommited changes in $1\n" |
|
|
printf "There are uncommited changes in $1\n" |
|
|
return 1 |
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
case "$1" in |
|
|
case "$1" in |
|
|
config) cp -r "$XDG_CONFIG_HOME/$2" "$BACKUPS_PATH/$1/$2";; |
|
|
|
|
|
macros) cp -r "$HOME/Macros/$2" "$BACKUPS_PATH/$1/$2";; |
|
|
|
|
|
|
|
|
config) cp -r $XDG_CONFIG_HOME/$2 "$BACKUPS_PATH/$1/$2";; |
|
|
|
|
|
macros) cp -r $HOME/Macros/$2 "$BACKUPS_PATH/$1/$2";; |
|
|
*) invalid_path_msg "$1"; return 1;; |
|
|
*) invalid_path_msg "$1"; return 1;; |
|
|
esac |
|
|
esac |
|
|
printf "backup overwrite successful\n" |
|
|
printf "backup overwrite successful\n" |
|
|