about summary refs log tree commit diff
path: root/scripts/capsule.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/capsule.sh')
-rwxr-xr-xscripts/capsule.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/scripts/capsule.sh b/scripts/capsule.sh
index cd102a7..45188f0 100755
--- a/scripts/capsule.sh
+++ b/scripts/capsule.sh
@@ -3,6 +3,27 @@
 # first arg:  build_dir
 # second arg: report path
 
+function jitterbug_build () {
+    if [ -f 'dist.ini' ]; then
+        echo "Found dist.ini, using Dist::Zilla"
+        dzil authordeps | cpanm
+        cpanm --installdeps .
+        HARNESS_VERBOSE=1 dzil test >> $logfile  2>&1
+    elif [ -f 'Build.PL' ]; then
+        echo "Found Build.PL, using Build.PL"
+        perl Build.PL
+        # ./Build installdeps is not available in older Module::Build's
+        cpanm --installdeps .
+        HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1
+    else
+        echo "Hoping to find Makefile.PL"
+        perl Makefile.PL
+        cpanm --installdeps .
+        make
+        HARNESS_VERBOSE=1 make test >> $logfile 2>&1
+    fi
+}
+
 # this is getting smelly
 builddir=$1
 report_path=$2
@@ -31,24 +52,3 @@ else
         logfile="$report_path/$theperl.txt"
         jitterbug_build
 fi
-
-function jitterbug_build () {
-    if [ -f 'dist.ini' ]; then
-        echo "Found dist.ini, using Dist::Zilla"
-        dzil authordeps | cpanm
-        cpanm --installdeps .
-        HARNESS_VERBOSE=1 dzil test >> $logfile  2>&1
-    elif [ -f 'Build.PL' ]; then
-        echo "Found Build.PL, using Build.PL"
-        perl Build.PL
-        # ./Build installdeps is not available in older Module::Build's
-        cpanm --installdeps .
-        HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1
-    else
-        echo "Hoping to find Makefile.PL"
-        perl Makefile.PL
-        cpanm --installdeps .
-        make
-        HARNESS_VERBOSE=1 make test >> $logfile 2>&1
-    fi
-}