orama/core/.githooks/pre-push

19 lines
407 B
Bash

#!/bin/bash
# Colors for output
CYAN='\033[0;36m'
GREEN='\033[0;32m'
RED='\033[0;31m'
NOCOLOR='\033[0m'
# Run tests before push
echo -e "\n${CYAN}Running tests...${NOCOLOR}"
go test ./... # Runs all tests in your repo
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}Push aborted: some tests failed.${NOCOLOR}"
exit 1
else
echo -e "${GREEN}All tests passed. Proceeding with push.${NOCOLOR}"
fi