Repository navigation
Expand file tree
/
Copy pathfull_install_biop_qupath.sh
More file actions
89 lines (79 loc) · 2.28 KB
/
Copy pathfull_install_biop_qupath.sh
File metadata and controls
89 lines (79 loc) · 2.28 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
################################################################################
# Help #
################################################################################
function Help()
{
# Display Help
echo ------ BIOP QuPath Full Installer -------------
echo "This script executes sequentially:"
echo " - install_qupath.sh"
echo " - install_qupath_extensions.sh"
echo
echo "You need to specify the folder where Qupath should be installed as an "
echo "argument of this script. For instance: "
echo "Fiji needs to be already installed in the same path"
echo ""
echo "Windows:"
echo "./full_install_biop_qupath.sh C:/"
echo ""
echo "If no path is specified, you will be asked for one."
echo
}
while getopts ":h" option; do
case $option in
h) # display Help
Help
exit;;
esac
done
# ----------------- FUNCTIONS -------------------
# Wait for user
function pause(){
read -p "$*"
}
# Returns
function getuserdir(){
local __resultvar=$1
local myresult=
while true ; do
read -r -p "Path: " myresult
if [ -d "$myresult" ] ; then
break
fi
echo "$myresult is not a directory... try without slash at the end (unless it's the root drive like C:/)"
done
eval $__resultvar="'$myresult'"
}
echo ------ QuPath BIOP Full Installer Script -------------
echo "This batch file downloads and install QuPath + extensions on your computer"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Your OS: Linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Your OS: Mac OSX"
elif [[ "$OSTYPE" == "msys" ]]; then
echo "Your OS: Windows"
else
echo "Unknown OS, the script will exit: $OSTYPE"
pause "Press [Enter] to end the script"
exit 1 # We cannot proceed
fi
# ------- INSTALLATION PATH VALIDATION
echo ------- Installation path validation
if [ $# -eq 0 ]
then
echo "Please enter the installation path"
getuserdir path_install
else
if [ -d "$1" ] ; then
path_install=$1
else
echo $1 is not a valid path
echo "Please enter the installation path"
getuserdir path_install
fi
fi
echo "All components will be installed in:"
echo "$path_install"
./install_qupath.sh "$path_install"
./install_qupath_extensions.sh "$path_install"