-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathload_tutu
More file actions
33 lines (28 loc) · 800 Bytes
/
load_tutu
File metadata and controls
33 lines (28 loc) · 800 Bytes
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
function {
local BASE_DIR=${TUTU_BASE_DIR:=$HOME/.tutu}
local CORE_DIR=$BASE_DIR/lib/core
declare -a required_files=(
tutu
completion
);
declare -a optional_files=(
);
local error=0
for required in $required_files; do
full_path=$CORE_DIR/$required
if [[ -f $full_path ]]; then
echo "Loading $full_path";
source $full_path
else
echo "Required file: '$full_path' is missing."
echo 'tutu not installed yet! Run "make install" or follow the README instructions'
error=1;
fi
done
for optional in $optional_files; do
if [[ !error && -f $optional ]]; then
echo "Loading $full_path";
source $optional
fi
done
}