-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·55 lines (44 loc) · 1.28 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
set -e
if [ -z "$1" ]
then
echo "Usage : ./install.sh /path/to/mm/folder"
exit 1
fi
IMAGEJ_ROOT=$1
MM_ANCHOR="$IMAGEJ_ROOT/plugins/Micro-Manager/MMJ_.jar"
FIJI_ANCHOR="$IMAGEJ_ROOT/jars/fiji-2.0.0-SNAPSHOT.jar"
if [ ! -f "$MM_ANCHOR" ] && [ ! -f "$FIJI_ANCHOR" ]
then
echo "Does $IMAGEJ_ROOT really contain Micro-Manager/Fiji ?"
exit 1
fi
# Install MAARS plugin
if [ -f "$MM_ANCHOR" ]; then
bash copyMMDeps.sh
rm -f $IMAGEJ_ROOT/mmplugins/maars*.jar
cp jars/maars*.jar $IMAGEJ_ROOT/mmplugins/
fi
if [ -f "$FIJI_ANCHOR" ]; then
bash copyFijiDeps.sh
rm -f $IMAGEJ_ROOT/jars/maars*.jar
cp jars/maars*.jar $IMAGEJ_ROOT/jars/
fi
# Install dependencies
rm -fr $IMAGEJ_ROOT/plugins/MAARS_deps
mkdir -p $IMAGEJ_ROOT/plugins/MAARS_deps
function join_by { local IFS="$1"; shift; echo "$*"; }
for jarPath in jars/MAARS_deps/*
do
jarPathAry=(${jarPath//// })
jarName=(${jarPathAry[2]//-/ })
nameLen=${#jarName[@]}
artifactNameary=${jarName[*]:0:$nameLen - 1 }
artifactName=$(join_by - $artifactNameary)
res=$(find $IMAGEJ_ROOT -name $artifactName*.jar )
if [ "$res" == "" ] && [ "$artifactName" != maars_lib-2.0.0 ] ; then
cp $jarPath $IMAGEJ_ROOT/plugins/MAARS_deps
echo "$jarPath copied"
fi
done
echo "Installation done to $IMAGEJ_ROOT"