We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 966456f commit 48c4463Copy full SHA for 48c4463
.husky/pre-commit
@@ -1 +1,23 @@
1
-npm run build
+#!/bin/sh
2
+
3
+# Run build and capture output
4
+output=$(npm run build 2>&1)
5
+exit_code=$?
6
7
+# Display the output
8
+echo "$output"
9
10
+# Fail if build command failed
11
+if [ $exit_code -ne 0 ]; then
12
+ exit $exit_code
13
+fi
14
15
+# Fail if warnings were produced
16
+if echo "$output" | grep -qi "warning"; then
17
+ echo ""
18
+ echo "❌ Build produced warnings - commit blocked"
19
+ echo "Please fix the warnings above before committing."
20
+ exit 1
21
22
23
+echo "✅ Build passed with no warnings"
0 commit comments