Skip to content

Commit

Permalink
add *.csproj support to examples/gitserver/hooks/detect-language
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Minter committed Nov 25, 2016
1 parent 6683989 commit f715aa9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/gitserver/hooks/detect-language
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ set -o pipefail
function has {
[[ -n $(git ls-tree --full-name --name-only HEAD ${@:1}) ]]
}
function hasglob {
git ls-tree --full-name --name-only HEAD | while read NAME; do
[[ "$NAME" == $1 ]] && return 0
done
}
function key {
git config --local --get "${1}"
}
Expand Down Expand Up @@ -50,7 +55,12 @@ if has index.pl cpanfile; then
exit 0
fi

if has project.json; then
if has build.sbt; then
echo "${prefix}scala"
exit 0
fi

if has project.json || hasglob '*.csproj'; then
echo "${prefix}dotnet"
exit 0
fi
Expand Down

0 comments on commit f715aa9

Please sign in to comment.