diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-07 19:11:48 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-07 19:11:48 -0500 |
| commit | 437678d7f728666733bcd91c0b21c1a45f665648 (patch) | |
| tree | 694bd02e1640d693ce15b5d4e836d98c464dfc16 /scripts/cmail-setup-finish.sh | |
| parent | 64257ff711145b22812ae54df31d8b631c01e18e (diff) | |
| download | archsetup-437678d7f728666733bcd91c0b21c1a45f665648.tar.gz archsetup-437678d7f728666733bcd91c0b21c1a45f665648.zip | |
refactor(archsetup): break dotfile-restore chain into guarded steps
The previous block ran three operations under one error_warn: `cd "$dotfiles_dir" && git config --global --add safe.directory ... && git restore .`. If any one of them failed, the operator saw a single "restoring dotfile versions" warning with no clue which step broke. The cd was unnecessary because git's `-C` flag does the same thing without changing the calling shell's working directory.
I split the block into two guarded steps. The `safe.directory` config runs first with its own error_warn. If that step succeeds, the `git restore` runs next with its own error_warn. If `safe.directory` fails, the dotfile restore is skipped entirely. The original cause gets logged once instead of cascading into a second error from git's dubious-ownership check. I also dropped the `cd` and used `git -C "$dotfiles_dir"` instead.
Diffstat (limited to 'scripts/cmail-setup-finish.sh')
0 files changed, 0 insertions, 0 deletions
