diff --git a/install_dotfiles.sh b/install_dotfiles.sh index 7bfc087..0963012 100755 --- a/install_dotfiles.sh +++ b/install_dotfiles.sh @@ -110,12 +110,12 @@ say_bold "Copying contents of $OS dotfiles to $TARGET_DIR..." if command -v rsync >/dev/null 2>&1; then # Ensure a trailing slash on the source to copy contents *of* the directory - rsync -avz "$DOTFILES_SRC_DIR/" "$TARGET_DIR" + sudo rsync -avz "$DOTFILES_SRC_DIR/" "$TARGET_DIR" say_green "Successfully synchronized dotfiles using rsync." else # Fallback to cp if rsync is not available say_yellow "rsync not found. Falling back to 'cp -r'." - cp -r "$DOTFILES_SRC_DIR/." "$TARGET_DIR" + sudo cp -r "$DOTFILES_SRC_DIR/." "$TARGET_DIR" say_green "Successfully copied dotfiles using cp." fi @@ -130,8 +130,8 @@ say_yellow "First we make a backup of .config" say_yellow "Wait for it ...." say_yellow "########################################################################" -cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H.%M.%S) -cp -arf /etc/skel/. ~ +sudo cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H.%M.%S) +sudo cp -arf /etc/skel/. ~ say_yellow "##############################################################" say_yellow "################### $(basename $0) done"