Skip to content

Commit

Permalink
remove backup
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaw353 authored Nov 10, 2024
1 parent a6dd259 commit f5bf4fb
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions dotfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,6 @@ function _task_done {
_clear_task
}

# Backup dotfiles function with error handling
function backup_dotfiles {
local backup_dir="$HOME/dotfiles_backup/$(date +'%Y%m%d_%H%M%S')"
_task "Creating backup directory: $backup_dir"
if mkdir -p "$backup_dir"; then
_task "Backing up dotfiles"
cp -r "$DOTFILES_DIR/"* "$backup_dir/" 2>/dev/null && _task_done || {
printf "${LYELLOW} [-] Failed to find files to back up. Skipping.${RESTORE}\n"
return 1
}
else
printf "${LYELLOW} [-] Could not create backup directory. Skipping backup.${RESTORE}\n"
return 1
fi
}

# Arch setup function
function arch_setup {
for pkg in ansible curl python python-pip python-watchdog openssh rsync git noto-fonts-emoji; do
Expand Down Expand Up @@ -188,9 +172,6 @@ function download_latest_release {
local zip_url=$(get_latest_zip)
local zip_file="$HOME/dotfiles_latest.zip"

_task "Backing up existing dotfiles"
backup_dotfiles

_task "Downloading the latest release from GitHub"
_cmd "curl -L -o $zip_file $zip_url" 3 2 "Failed to download the latest release."

Expand Down Expand Up @@ -224,9 +205,6 @@ case $ID in
;;
esac

# Run backup and installation/update tasks based on mode
backup_dotfiles

if [[ $MODE == "rolling" ]]; then
clone_repository
else
Expand Down

0 comments on commit f5bf4fb

Please sign in to comment.