Skip to content

fix(scripts): pass --source to chezmoi execute-template - #172

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
droid/ghi169-fix-rectangle-include
Open

fix(scripts): pass --source to chezmoi execute-template#172
github-actions[bot] wants to merge 1 commit into
mainfrom
droid/ghi169-fix-rectangle-include

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Automated fix attempt

This PR was generated by the droid-issue-fixer GitHub Action, which runs droid exec headlessly to attempt an open issue.

Closes #169

Droid exec summary

Fixed #169 in scripts/lint-shell-templates.sh.

What changed:

  • render_template() now passes --source "$repo_root" to chezmoi execute-template, so include directives resolve against the repository being linted instead of the default ~/.local/share/chezmoi.
  • While editing the same script, I also split local rendered=... into a separate declaration and assignment to resolve shellcheck SC2155 ([sweeper] scripts/lint-shell-templates.sh #167).

Why:

  • The Rectangle reload template (private_Library/private_Preferences/run_onchange_reload-rectangle.sh.tmpl) embeds a sha256 hash via include "private_Library/private_Preferences/com.knollsoft.Rectangle.plist". Without --source, chezmoi looked in ~/.local/share/chezmoi and failed to find the plist on CI runners.

Validation:

  • bash -n scripts/lint-shell-templates.sh passed.
  • shellcheck scripts/lint-shell-templates.sh passed.
  • ./scripts/lint-shell-templates.sh passed for all templates.
  • chezmoi execute-template --source /home/runner/work/dotfiles/dotfiles < private_Library/private_Preferences/run_onchange_reload-rectangle.sh.tmpl now renders successfully and produces the expected sha256 hash.

render_template() in scripts/lint-shell-templates.sh rendered
templates against the default chezmoi source directory, so include
directives like the one in the Rectangle reload script failed on
runners where ~/.local/share/chezmoi is not the repo root.

Add --source "$repo_root" so chezmoi execute-template resolves
includes relative to the repository being linted.

While editing this script, also split the local rendered=...
declaration in lint_zsh_template() to avoid masking the return
value of the command substitution (shellcheck SC2155).

Closes #169
Fixes #167
@github-actions github-actions Bot added the droid PR generated by droid-issue-fixer action label Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

droid PR generated by droid-issue-fixer action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sweeper] private_Library/private_Preferences/run_onchange_reload-rectangle.sh.tmpl

1 participant