From a3e577fc996ad5c2715c411ad4f6a108a7b02c42 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Wed, 28 Mar 2018 16:49:13 +0200
Subject: [PATCH] Make path to Fiji configurable and check it

---
 scripts/build_and_deploy.sh | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/scripts/build_and_deploy.sh b/scripts/build_and_deploy.sh
index 180291a..91f64de 100644
--- a/scripts/build_and_deploy.sh
+++ b/scripts/build_and_deploy.sh
@@ -5,9 +5,24 @@ set -e
 
 cd $(dirname $0)/..
 
+
+
+FIJI_APP="/opt/Fiji.app"
+if [ -n "$1" ] ; then
+    FIJI_APP="$1"
+fi
+
+PLUGINS="$FIJI_APP/plugins/"
+if ! [ -d "$PLUGINS" ] ; then
+    echo "ERROR: can't find Fiji plugins directory: [$PLUGINS]"
+    echo "Make sure to specify the *ABSOLUTE* path to a Fiji installation!"
+    exit 1
+fi
+
+
 ### build
 mvn
 
 ### deploy
-find /opt/Fiji.app/plugins/ -name 'NoiSee-*.jar' | xargs --no-run-if-empty rm -v
-cp -v $(find target -iname '*.jar' -and -not -iname '*-sources.jar') /opt/Fiji.app/plugins/
+find "$PLUGINS" -name 'NoiSee-*.jar' | xargs --no-run-if-empty rm -v
+cp -v $(find target -iname '*.jar' -and -not -iname '*-sources.jar') "$PLUGINS"
-- 
GitLab