Closed MRDGH2821 closed 20 hours ago
The error happens because you have two scripts with the same target name (their names after their attributes are removed):
run_once_before_linux-install-packages.sh
run_onchange_linux-install-packages.sh.tmpl
The target name for both of these scripts is linux-install-packages.sh
.
If you want to keep their behaviors (run_once_before
and run_onchange
), you need to give them unique target names.
I recommend using numbered scripts like one would do with rc scripts. My .chezmoiscripts
is:
run_after_fisher-update.sh
run_once_before-01-install-macports.sh
run_once_before-02-install-homebrew.sh
run_once_before-03-install-rust.sh
run_once_before_00-prepare-system.sh
run_onchange_after-01-install-macports-packages.sh.tmpl
run_onchange_after-02-install-homebrew-packages.sh.tmpl
run_onchange_after-03-install-rust-packages.sh.tmpl
run_onchange_after-04-install-gobin.sh.tmpl
run_onchange_after-05-install-code-extensions.sh.tmpl
run_onchange_after-06-update-vim-spell.sh.tmpl
run_onchange_after-07-configure-apps.sh
Thanks for the solution!
I ran various scripts multiple times & it is working consistently
What exactly are you trying to do?
Making my dotfiles sturdy enough to install all packages I need across Windows, Ubuntu & Fedora (and possibly Arch) My repo - https://github.com/MRDGH2821/dotfiles/
I have made run before scripts to initialise things on ubuntu/debian based systems, but none for fedora or arch. Then there is declarative installation of apps handled by chezmoi. And finally run after script which runs rew commands.
What have you tried so far?
I assumed it would be dashes problem in templates, thus I removed them. But no luck.
Where else have you checked for solutions?
https://www.chezmoi.io/user-guide/frequently-asked-questions/design/#can-chezmoi-support-multiple-sources-or-multiple-source-states
Output of any commands you've tried with
--verbose
flagOutput of
chezmoi doctor
Details
```console $ chezmoi doctor RESULT CHECK MESSAGE ok version v2.52.2, commit f91dbfc2256b59c003ecdf28815a265e48eeecc3, built at 2024-09-10T00:13:37Z, built by goreleaser ok latest-version v2.52.2 ok os-arch linux/amd64 (Fedora Linux 40 (KDE Plasma)) ok uname Linux localhost-live.mshome.net 6.10.9-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Sep 8 17:23:55 UTC 2024 x86_64 GNU/Linux ok go-version go1.23.1 (gc) ok executable ~/bin/chezmoi ok upgrade-method replace-executable ok config-file ~/.config/chezmoi/chezmoi.toml, last modified 2024-09-16T22:41:06+05:30 warning source-dir ~/.local/share/chezmoi is a git working tree (dirty) ok suspicious-entries no suspicious entries warning working-tree ~/.local/share/chezmoi is a git working tree (dirty) ok dest-dir ~ is a directory ok umask 022 ok cd-command found /bin/bash ok cd-args /bin/bash info diff-command not set ok edit-command found ~/.local/bin/zed ok edit-args zed --wait ok git-command found /usr/bin/git, version 2.46.0 warning merge-command vimdiff not found in $PATH ok shell-command found /bin/bash ok shell-args /bin/bash info age-command age not found in $PATH ok gpg-command found /usr/bin/gpg, version 2.4.4 info pinentry-command not set info 1password-command op not found in $PATH info bitwarden-command bw not found in $PATH info bitwarden-secrets-command bws not found in $PATH info dashlane-command dcli not found in $PATH info doppler-command doppler not found in $PATH info gopass-command gopass not found in $PATH ok keepassxc-command found /usr/bin/keepassxc-cli, version 2.7.9 info keepassxc-db not set info keeper-command keeper not found in $PATH info lastpass-command lpass not found in $PATH info pass-command pass not found in $PATH info passhole-command ph not found in $PATH info rbw-command rbw not found in $PATH info vault-command vault not found in $PATH info vlt-command vlt not found in $PATH info secret-command not set ```
Additional context
I did go through this but somehow I'm not able to understand their script.