Browse code

add *.csproj support to examples/gitserver/hooks/detect-language

Jim Minter authored on 2016/11/26 02:12:17
Showing 1 changed files
... ...
@@ -14,6 +14,11 @@ set -o pipefail
14 14
 function has {
15 15
   [[ -n $(git ls-tree --full-name --name-only HEAD ${@:1}) ]]
16 16
 }
17
+function hasglob {
18
+  git ls-tree --full-name --name-only HEAD | while read NAME; do
19
+    [[ "$NAME" == $1 ]] && return 0
20
+  done
21
+}
17 22
 function key {
18 23
   git config --local --get "${1}"
19 24
 }
... ...
@@ -50,7 +55,12 @@ if has index.pl cpanfile; then
50 50
   exit 0
51 51
 fi
52 52
 
53
-if has project.json; then
53
+if has build.sbt; then
54
+  echo "${prefix}scala"
55
+  exit 0
56
+fi
57
+
58
+if has project.json || hasglob '*.csproj'; then
54 59
   echo "${prefix}dotnet"
55 60
   exit 0
56 61
 fi