Skip to content

Make bash-wrapper work; add tests#2

Merged
codeforester merged 1 commit intomainfrom
hpr/create-bash-wrapper
Apr 12, 2026
Merged

Make bash-wrapper work; add tests#2
codeforester merged 1 commit intomainfrom
hpr/create-bash-wrapper

Conversation

@codeforester
Copy link
Copy Markdown
Owner

Summary

This PR introduces the first version of the Bash command wrapper and tightens the Bash CLI foundation around it.

The main goal is to let Bash commands inherit the shared stdlib automatically, so individual command scripts do not need boilerplate just to source lib_std.sh. Along the way, this also adds wrapper documentation, broadens .gitignore, and expands test coverage for both the wrapper and the stdlib.

What Changed

  • added cli/bash/bin/bash-wrapper as the shared entrypoint for Bash commands
  • supported both invocation styles:
    • bash-wrapper <command> [args...]
    • <command> [args...] via a symlink to bash-wrapper
  • resolved commands from cli/bash/commands/<name>/main.sh, with fallback support for cli/bash/commands/<name>/<name>.sh
  • exported stable BANYAN_* path and command metadata from the wrapper for downstream scripts
  • preloaded cli/bash/lib/std/lib_std.sh inside the wrapper so command scripts can use stdlib helpers without sourcing it themselves
  • updated lib_std.sh to honor BANYAN_BASH_BOOTSTRAP_SOURCE, so __SCRIPT_DIR__ still points at the real command script even when the stdlib is sourced by the wrapper
  • added cli/bash/bin/README.md documenting the wrapper contract, layout, and usage
  • added a simple test_cmd command/symlink pair to exercise the wrapper flow
  • expanded .gitignore for macOS, editor, and common Python-generated files

Testing

  • added wrapper-specific BATS coverage under cli/bash/bin/tests/bash-wrapper.bats
  • significantly expanded cli/bash/lib/std/tests/lib_std.bats to cover stdlib initialization and most helper functions
  • shared test infrastructure remains under cli/bash/tests/

Validated with:

bats cli/bash/bin/tests/bash-wrapper.bats cli/bash/lib/std/tests/lib_std.bats

@codeforester codeforester merged commit ea74c72 into main Apr 12, 2026
0 of 3 checks passed
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