aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdot-backup.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/dot-backup.sh b/dot-backup.sh
index 4cee3fa..dd41199 100755
--- a/dot-backup.sh
+++ b/dot-backup.sh
@@ -274,7 +274,7 @@ do_restore() {
# ── MAIN ──────────────────────────────────────────────────────────────────────
-clear
+if [[ "$QUIET" == false ]]; then clear; fi
if [[ "$FIRST_RUN" == true ]]; then
echo -e "${GREEN}First run — config directories created:${NC}"
@@ -332,7 +332,7 @@ if [[ -n "$GIT_REMOTE" && "$DRY_RUN" == false ]]; then
echo -e "${YELLOW}Adding remote origin: $GIT_REMOTE${NC}"
git remote add origin "$GIT_REMOTE"
fi
- cd $WORKDIR
+ cd "$WORKDIR"
fi
if [[ "$DRY_RUN" == false ]]; then
@@ -340,23 +340,23 @@ if [[ "$DRY_RUN" == false ]]; then
fi
echo -e $NC
-cd $WORKDIR
+cd "$WORKDIR"
# we iterate all dotfiles in the list
for i in "${DOTFILES[@]}"; do
# if it's a file in my home
- if [[ -f ${HOME}/$i ]]; then
+ if [[ -f "${HOME}/$i" ]]; then
echo -e "${GREEN}${HOME}/$i${NC}"
do_rsync "${HOME}/$i" "${DEFAULT_OUTPUT_DIR}/home/$i"
# if it's a directory in my home
- elif [[ -d ${HOME}/$i ]]; then
+ elif [[ -d "${HOME}/$i" ]]; then
echo -e "${BLUE}${HOME}/$i${NC}"
do_rsync "${HOME}/$i" "${DEFAULT_OUTPUT_DIR}/home/$i" true
# if it begins with a / it's a system file/directory
elif beginswith "/" "$i"; then
- if [[ -f $i ]]; then
+ if [[ -f "$i" ]]; then
echo -e "${GREEN}$i${NC}"
do_rsync "$i" "${DEFAULT_OUTPUT_DIR}/system/${i#/}"
- elif [[ -d $i ]]; then
+ elif [[ -d "$i" ]]; then
echo -e "${BLUE}$i${NC}"
do_rsync "$i" "${DEFAULT_OUTPUT_DIR}/system/${i#/}" true
fi
@@ -393,6 +393,6 @@ if [[ "$PUSH" == true ]]; then
fi
echo -e $NC
-cd $WORKDIR
+cd "$WORKDIR"
if [[ "$QUIET" == true ]]; then echo "Log written to: $LOG_FILE" >&3; fi
exit 0