Skip to content

Commit

Permalink
fix: pre commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Jul 29, 2024
1 parent d9365b1 commit 41cd5be
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion hooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,18 @@ else
NC='\033[0m' # No Color
printf "${RED}Pushing to wrong branch. Stopping commit${NC}\n"
exit 1
fi
fi

# Check for _for_test_server.go files in recipe directory
test_server_files=$(find ./recipe -name "*_for_test_server.go")

if [ ! -z "$test_server_files" ]; then
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "${RED}Error: Found _for_test_server.go files in recipe directory:${NC}\n"
echo "$test_server_files"
printf "${RED}These files should not be committed. Please remove them before committing.${NC}\n"
exit 1
fi

echo "No _for_test_server.go files found in recipe directory. Proceeding with commit."

0 comments on commit 41cd5be

Please sign in to comment.