You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(chezmoi): harden atuin postCreateCommand hook and add regression tests
- Replace dynamic environment variable assignment with literal heredoc + sed placeholder injection pattern (consistent with persist-ccache and persist-pre-commit features)
- Add early exit if atuin credentials are not configured (graceful no-op)
- Add explicit check for atuin binary before attempting login/sync (prevents 'command not found' from blocking container start)
- Separate atuin-specific operations from /.persist-shell-history symlink setup for better error isolation
- Add regression scenario test with dummy atuin credentials but no atuin installed
- Expand test.sh checks to verify postCreateCommand script exists and chezmoi state is initialized
- Update README to clarify that atuin, starship, and shell themes are not installed by this feature
- Document optional atuin integration and relationship to persist-shell-history feature
Fixes regression where postCreateCommand would fail with 'atuin: command not found' when atuin_user/password/key were configured but atuin binary was not installed, breaking container initialization and shell setup.
Copy file name to clipboardExpand all lines: src/chezmoi/README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,21 @@
1
1
2
2
# Chezmoi (chezmoi)
3
3
4
-
Install chezmoi and apply dotfiles.
4
+
Install chezmoi and apply dotfiles during the container build.
5
+
6
+
## Behavior
7
+
8
+
This feature:
9
+
10
+
- Installs chezmoi
11
+
- runs `chezmoi init --apply --exclude=encrypted` for the configured user during the build
12
+
- creates `/usr/local/share/chezmoi-atuin-init.sh` as a `postCreateCommand`
13
+
14
+
If `atuin_user`, `atuin_password`, and `atuin_key` are set, the post-create hook prepares optional Atuin history persistence and then runs `atuin login` and `atuin sync` when the `atuin` binary is available.
15
+
16
+
This feature does not install Atuin, Starship, or shell themes. Those tools must come from your dotfiles repository or another feature.
17
+
18
+
To persist Atuin history across rebuilds, combine this feature with [persist-shell-history](../persist-shell-history/).
5
19
6
20
## Example Usage
7
21
@@ -12,3 +26,17 @@ Install chezmoi and apply dotfiles.
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
42
42
# check <LABEL> <cmd> [args...]
43
43
check "validate if chezmoi command is installed" chezmoi --version
44
+
check "validate if chezmoi Atuin init script exists"test -x /usr/local/share/chezmoi-atuin-init.sh
45
+
# shellcheck disable=SC2016
46
+
check "validate if chezmoi has been initialized for the current user" sh -c 'source_path=$(chezmoi source-path) && [ -n "$source_path" ] && [ -d "$source_path" ]'
44
47
45
48
# Report result
46
49
# If any of the checks above exited with a non-zero exit code, the test will fail.
0 commit comments