Make chezmoi sync conditional on chezmoi being installed

Skip chezmoi add/re-add steps on VMs where chezmoi is not available.
This commit is contained in:
Viktor Barzin 2026-02-06 19:39:17 +00:00
parent 369a4fdaa7
commit 310cb7b17b

View file

@ -3,12 +3,13 @@
## Preferences ## Preferences
### Chezmoi Sync ### Chezmoi Sync
When making changes to dotfiles (including Claude files in `~/.claude/`), always: When making changes to dotfiles (including Claude files in `~/.claude/`), sync with chezmoi **only if it is installed** (`command -v chezmoi`):
1. Sync with chezmoi: 1. Sync with chezmoi:
- `chezmoi add <file>` for new files - `chezmoi add <file>` for new files
- `chezmoi re-add <file>` for updated files - `chezmoi re-add <file>` for updated files
2. Commit the changes in the chezmoi source directory: 2. Commit the changes in the chezmoi source directory:
- `cd $(chezmoi source-path) && git add -A && git commit -m "<descriptive message>"` - `cd $(chezmoi source-path) && git add -A && git commit -m "<descriptive message>"`
If chezmoi is not installed, skip the sync steps and just make the changes directly.
### Claude Plugins ### Claude Plugins
When installing new Claude plugins or marketplaces, update these files: When installing new Claude plugins or marketplaces, update these files: