feat: generated libraries are zsh-ready (test scaffold + full shell CI)#2
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
cookiecutter-generated libraries zsh-ready out of the box.{{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_renderso GitHub's${{ }}expressions survive Jinja rendering.~/.xshrc(runs under bash or zsh), derives the lib name fromxsh.lib, import-smokes the utilities.setup.ymlrelocates the generated.github/workflows/test.yml(hidden dir missed by themv … *glob).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