Files
newz-qwen-27b/hooks/pre-push
T
Daniel Samson 357a72114b chore: initial project setup for newzy
Add repository scaffolding: .gitignore, README, CONTRIBUTING, MIT
license, pre-push quality hook, and documentation covering branching,
file conventions, and commit style. Establish the main/develop
branching strategy. This is project setup only; no application
functionality is included.
2026-10-30 12:18:31 +00:00

29 lines
709 B
Bash
Executable File

#!/usr/bin/env sh
# pre-push — code quality checks before pushing to the remote.
#
# Install (per clone):
# git config core.hooksPath hooks
#
# The hook is a no-op until the application toolchain (package.json)
# exists. When it does, `lint` and `test` scripts are run if defined.
status=0
if [ -f package.json ]; then
if npm run lint --if-present --silent; then
echo "pre-push: lint passed"
else
echo "pre-push: lint FAILED — push aborted" >&2
status=1
fi
if [ "$status" -eq 0 ] && npm run test --if-present --silent; then
echo "pre-push: tests passed"
else
[ "$status" -eq 0 ] && echo "pre-push: tests FAILED — push aborted" >&2
status=1
fi
fi
exit "$status"