feat: zsh support — test suite + bash/zsh CI - #1
Merged
Conversation
The utilities are already zsh-compatible (xsh runs them under ksh emulation):
config.sh's getopts loop only reads OPTARG with no nested getopts-util call,
its /json/parser call is captured in $(), and there are no ${!var}/FUNCNAME/
read-array/special-var-local constructs. This change adds what was missing —
tests and CI — to prove and keep it that way.
- New test.sh: import-smokes the function utilities, then asserts
ss/libev/plugin/v2ray/config rewrites a config to add the v2ray-plugin
plugin/plugin_opts keys (incl. the -n/-c/-k tls variant) and errors on a
missing config. Self-sources ~/.xshrc so it runs under bash or zsh.
- New CI: os × {bash, zsh} matrix; loads xsh-lib/core then this library.
Verified under zsh 5.9 and macOS bash 3.2.57. Requires xsh >= 0.7.0 for zsh.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror alexzhangs/xsh's CI matrix: bash 3.2 (macOS), 4.4 (rockylinux:8), 5.x (Linux + Homebrew macOS), zsh 5.x (macOS + Linux). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A scalar starting with a double quote (`run: "$SHELL_PATH" ...`) is parsed by YAML as a quoted string with trailing junk, so the workflow failed to parse (0 jobs ran). Use a block scalar. 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 shadowsocks zsh-ready. The utilities are already zsh-compatible under xsh's ksh emulation (no
${!var}/FUNCNAME/read-array/special-var-local constructs; the getopts loop reads only OPTARG; the/json/parsercall is$()-isolated). This adds the missing test suite + bash/zsh CI to prove it.test.sh: import-smoke + functional assertions forconfig(plugin/plugin_opts rewrite incl. tls variant, missing-file error). Self-sources~/.xshrcto run under either shell.os × {bash, zsh}matrix; loads xsh-lib/core then this lib.Verified under zsh 5.9 + macOS bash 3.2.57. Requires xsh >= 0.7.0 for zsh. 🤖 Generated with Claude Code