Skip to content

feat: generated libraries are zsh-ready (test scaffold + full shell CI)#2

Merged
alexzhangs merged 1 commit into
mainfrom
feature/zsh-support
Jun 14, 2026
Merged

feat: generated libraries are zsh-ready (test scaffold + full shell CI)#2
alexzhangs merged 1 commit into
mainfrom
feature/zsh-support

Conversation

@alexzhangs

Copy link
Copy Markdown
Contributor

Makes cookiecutter-generated libraries zsh-ready out of the box.

  • New skeleton CI ({{cookiecutter.lib_name}}/.github/workflows/test.yml): the canonical matrix mirroring alexzhangs/xsh — bash 3.2/4.4/5.x (incl. rockylinux:8 container + Homebrew macOS) + zsh 5.x (macOS+Linux). Self-describing via ${{ github.repository }} (no per-lib edits); listed in _copy_without_render so GitHub's ${{ }} expressions survive Jinja rendering.
  • New skeleton test.sh: self-sources ~/.xshrc (runs under bash or zsh), derives the lib name from xsh.lib, import-smokes the utilities.
  • setup.yml relocates the generated .github/workflows/test.yml (hidden dir missed by the mv … * glob).
  • Skeleton README notes zsh support.

Verified locally with cookiecutter: xsh.lib/README render, the workflow copies verbatim (GHA expressions intact, valid YAML), and the skeleton test.sh parses under bash 3.2 + zsh. 🤖 Generated with Claude Code

Make `cookiecutter` produce libraries that are zsh-ready out of the box:

- New `{{cookiecutter.lib_name}}/.github/workflows/test.yml`: the canonical CI
  mirroring alexzhangs/xsh's shell matrix (bash 3.2/4.4/5.x + zsh 5.x). It is
  self-describing (loads `${{ github.repository }}`), so it needs no per-library
  edits; listed in `_copy_without_render` so GitHub's `${{ }}` expressions
  survive Jinja rendering.
- New `{{cookiecutter.lib_name}}/test.sh`: a runnable skeleton that self-sources
  ~/.xshrc (so it runs under bash or zsh), derives the library name from
  xsh.lib, and import-smokes the utilities (a no-op until the author adds some).
- setup.yml now relocates the generated `.github/workflows/test.yml` (the hidden
  dir isn't matched by the `mv ... *` glob).
- Skeleton README notes zsh support.

Verified locally: `cookiecutter` generation renders xsh.lib/README and copies
the workflow verbatim (GHA expressions intact, valid YAML); the skeleton test.sh
parses under bash 3.2 and zsh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexzhangs alexzhangs merged commit 6f6b5be into main Jun 14, 2026
1 check passed
@alexzhangs alexzhangs deleted the feature/zsh-support branch June 14, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant