Edit Makefile:
.PHONY: lint ... new-target
help:
@echo "Available targets:"
...
@echo " new-target - Description here"
new-target:
@echo "Doing the thing..."
@command --arg- Create
scripts/my-script.sh - Add to top of file:
#!/bin/bash set -euo pipefail
- Update
Makefilelint/fmt targets to include new file - Run
make check
Critical: cli.sh is sourced into user's shell. Never add set -euo pipefail.
Guidelines:
- Keep functions modular (
cli→_cli_single) - Maintain backward compatibility (users source this directly)
- Test with fixtures:
cd tests/fixtures/X && source ../../cli.sh && cli
Test against all supported project types:
cd tests/fixtures/deno-project && source ../../cli.sh && cli
cd tests/fixtures/npm-project && source ../../cli.sh && cli
cd tests/fixtures/scripts-project && source ../../cli.sh && cli
cd tests/fixtures/make-project && source ../../cli.sh && cli