-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·58 lines (35 loc) · 965 Bytes
/
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
56
57
#!/bin/bash
HERE="$(dirname -- "$0")"
if [ -z "$SUBMODULES_HOME" ]; then
echo "ERROR: SUBMODULES_HOME not defined"
exit 1
fi
# shellcheck disable=SC2012
FILES_COUNT=$(ls "$SUBMODULES_HOME" -1 | wc -l)
if [ ! "$FILES_COUNT" = "0" ]; then
echo "ERROR: Directory is not empty '$SUBMODULES_HOME'"
exit 1
fi
TARGET="$SUBMODULES_HOME"
if test -e "$TARGET"; then
echo "Installing the Project Toolkit into: '$TARGET' (1)"
else
if mkdir -p "$TARGET"; then
if test -e "$TARGET"; then
echo "Installing the Project Toolkit into: '$TARGET' (2)"
else
echo "ERROR: The '$TARGET' directory does not exist"
exit 1
fi
else
echo "ERROR: The '$TARGET' directory failed to create"
exit 1
fi
fi
SCRIPT_INSTALL="$HERE/Recipes/Installable/install.sh"
if ! test -e "$SCRIPT_INSTALL"; then
echo "ERROR: Script not found '$SCRIPT_INSTALL'"
exit 1
fi
echo "Installing Project Toolkit"
bash "$SCRIPT_INSTALL"