alichtman / shallow-backup

Git-integrated backup tool for macOS and Linux devs.
MIT License
1.21k stars 247 forks source link

Broken backup flow if there's a config error #347

Open alichtman opened 3 weeks ago

alichtman commented 3 weeks ago
dotfiles on  main took 1s
03:50:54 PM ➜ shallow-backup --backup-dots

              dP                dP dP                        dP                         dP
              88                88 88                        88                         88
     ,d8888'  88d888b. .d8888b. 88 88 .d8888b. dP  dP  dP    88d888b. .d8888b. .d8888b. 88  .dP  dP    dP 88d888b.
     Y8ooooo, 88'  `88 88'  `88 88 88 88'  `88 88  88  88    88'  `88 88'  `88 88'  `"" 88888"   88    88 88'  `88
           88 88    88 88.  .88 88 88 88.  .88 88.88b.88'    88.  .88 88.  .88 88.  ... 88  `8b. 88.  .88 88.  .88
     `88888P' dP    dP `88888P8 dP dP `88888P' 8888P Y8P     88Y8888' `88888P8 `88888P' dP   `YP `88888P' 88Y888P'
                                                                                                          88
                                                                                                          dP
        v6.3a by Aaron Lichtman (@alichtman)

Detected git repo.
Updating .gitignore file at /home/alichtman/shallow-backup/.gitignore with config from root-gitignore
Updating .gitignore file at /home/alichtman/shallow-backup/dotfiles/.gitignore with config from dotfiles-gitignore

##########
# DOTFILES
##########

Backing up dotfolders...
Backing up dotfiles...
Error copying: /home/alichtman/.config/agignore
 -> This may mean you have an error in your config.
Error copying: /home/alichtman/.config/crontab
 -> This may mean you have an error in your config.
Error copying: /home/alichtman/.config/nvim-old
 -> This may mean you have an error in your config.

[?] If you do not, the parent repo will not be able to commit the dotfile changes...:
 >  Yes
    No

Cancelled by user
omarluq commented 2 weeks ago

Having the same issue, any hacks around this?

alichtman commented 2 weeks ago

Arguably, you should not be hacking around it. You should fix your config file to not have errors (in my case, I was attempting to back up files that no longer exist).

I don't think this should silently succeed -- it probably indicates your backup isn't doing what you think it is.

The details I added in the issue are sparse, but my intent is to make this error hard, so you must fix the config if you want to run a backup.