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 88d518c commit 90465c9Copy full SHA for 90465c9
pre-commit
@@ -1,7 +1,23 @@
1
#!/bin/sh
2
3
-echo "dotnet build"
+exists=0
4
+echo "do a check for .cs files in change set"
5
+while read status file; do
6
+ if [ "${file: -3}" == ".cs" ] ; then
7
+ exists=1
8
+ echo "find .cs file"
9
+ break
10
+ fi
11
+done <<<$(git diff --cached --name-status)
12
+
13
+echo $exists
14
+if [[ $exists -eq 0 ]] ; then
15
+ exit 0
16
+else
17
+ echo "exists .cs file, so build the project"
18
+fi
19
20
+echo "dotnet build"
21
dotnet clean; dotnet build
22
rc=$?
23
@@ -20,4 +36,4 @@ if [[ $rc != 0 ]] ; then
36
exit $rc
37
fi
38
-exit 0
39
+exit 0
0 commit comments