Skip to content
Browse files

Do not detect Play 2.0 apps as Play 1.2.x by checking for non-existance

of project/Build.scala file.
  • Loading branch information...
1 parent 75b70b8 commit f979e4415f2a44442c2c2e0fea782ef68b8f3175 @ryanbrainard ryanbrainard committed
Showing with 18 additions and 2 deletions.
  1. +5 −2 bin/detect
  2. +13 −0 test/detect_test.sh
View
7 bin/detect
@@ -1,8 +1,11 @@
#!/usr/bin/env bash
# bin/use <build-dir>
-play_confs=`cd $1; find . -wholename "*/conf/application.conf" ! -wholename "*modules*" -type f`
-if [ -n "$play_confs" ]; then
+BUILD_DIR=$1
+
+play_confs=$(cd $BUILD_DIR; find . -wholename "*/conf/application.conf" ! -wholename "*modules*" -type f)
+
+if [ -n "$play_confs" ] && [ ! -f "$BUILD_DIR/project/Build.scala" ]; then
echo "Play!" && exit 0
else
echo "no" && exit 1
View
13 test/detect_test.sh
@@ -31,3 +31,16 @@ testConfFileWithModulesDirectoryDoesNotDetectPlayApp() {
assertNoAppDetected
}
+
+testPlay20NotDetected()
+{
+ mkdir ${BUILD_DIR}/project
+ touch ${BUILD_DIR}/project/Build.scala
+ mkdir ${BUILD_DIR}/conf
+ touch ${BUILD_DIR}/conf/application.conf
+
+ detect
+
+ assertNoAppDetected
+}
+

0 comments on commit f979e44

Please sign in to comment.
Something went wrong with that request. Please try again.