-
Notifications
You must be signed in to change notification settings - Fork 0
/
open
executable file
·67 lines (44 loc) · 1.24 KB
/
open
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
#!/bin/bash
HERE=$(pwd)
SCRIPT_DO_OPEN="$HERE/do_open"
SCRIPT_PRE_OPEN="$HERE/pre_open"
SCRIPT_POST_OPEN="$HERE/post_open"
# shellcheck disable=SC1090
if test -e "$SCRIPT_PRE_OPEN"; then
if ! . "$SCRIPT_PRE_OPEN"; then
echo "ERROR: Pre-open failed"
exit 1
fi
fi
if [ -z "$SUBMODULES_HOME" ]; then
echo "ERROR: The 'SUBMODULES_HOME' variable is not defined"
exit 1
fi
SCRIPT_PREPARE_LOCAL="$HERE/prepare"
if ! test -e "$SCRIPT_PREPARE_LOCAL" || ! test -e "$SCRIPT_DO_OPEN"; then
SCRIPT_PREPARE_TOOLKIT="$SUBMODULES_HOME/prepare"
if test -e "$SCRIPT_PREPARE_TOOLKIT"; then
if ! bash "$SCRIPT_PREPARE_TOOLKIT" >/dev/null 2>&1; then
echo "ERROR: Script failed '$SCRIPT_PREPARE_TOOLKIT'"
exit 1
fi
else
echo "ERROR: Script not found '$SCRIPT_PREPARE_TOOLKIT'"
exit 1
fi
fi
if test -e "$SCRIPT_PREPARE_LOCAL"; then
if ! bash "$SCRIPT_PREPARE_LOCAL" >/dev/null 2>&1; then
echo "ERROR: Local prepare script failed"
exit 1
fi
fi
if test -e "$SCRIPT_DO_OPEN"; then
bash "$SCRIPT_DO_OPEN"
fi
if test -e "$SCRIPT_POST_OPEN"; then
if ! bash "$SCRIPT_POST_OPEN"; then
echo "ERROR: Post-open failed"
exit 1
fi
fi