You have a powerful repository initializer — scripts/git_init.sh — that supports interactive prompts and programmatic --headless invocations. This quest will guide you through validating the script’s behavior, adding tests, and ensuring it behaves well in CI.
Why this matters:
bash -n and lint with shellcheck.--headless operations do not push.--no-push for local tests.We suggest two layers of tests:
bats.shellcheck.tests/bats/test_headless.bats)#!/usr/bin/env bats
setup() {
TMPDIR=$(mktemp -d)
cd "$TMPDIR"
}
teardown() {
rm -rf "$TMPDIR"
}
@test "headless mode creates a repo and does not push" {
run bash /path/to/scripts/git_init.sh --headless -n sample-test --no-push
[ "$status" -eq 0 ]
[ -d "$HOME/github/sample-test/.git" ]
}
Install with brew install shellcheck on macOS and run shellcheck scripts/git_init.sh.
Use bash -n scripts/git_init.sh to detect syntax issues early.
bash -n scripts/git_init.sh
bash scripts/git_init.sh --headless -n test-quest-sample --no-push --gitignore python,macos --scaffold python
# install bats-core
brew install bats-core
bats tests/bats
brew install shellcheck
shellcheck scripts/git_init.sh
bash -n returns no errorshellcheck returns no major errorsbats tests/bats/test_headless.bats returns pass for headless creation--gitignore creates a .gitignore file when requested--scaffold python creates src and tests--dry-run prints operations and does not create files or push--dry-run to preview changes without applying them.Complete this quest to prove you can safely add features to a script and make it testable in automation.
Good luck! 🛠️