-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
36 lines (27 loc) · 985 Bytes
/
bootstrap.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
#!/bin/bash
export BERSEKER_PROJECT_PATH="$(realpath "$(dirname $0)/..")"
export BERSEKER_SCRIPTS_PATH="${BERSEKER_PROJECT_PATH}/scripts"
function __check_and_run_berseker_script() {
if [[ "$BERSEKER_PROJECT_PATH" != "$(realpath .)" ]] then;
echo "Invalid working directory you must be at ${BERSEKER_PROJECT_PATH} to run this command" >&2
exit -1
fi
script_path="${BERSEKER_SCRIPTS_PATH}/$1"
if [ -f $script_path ]; then
eval $script_path "${@:2}"
else
echo -e "Invalid path to script ${script_path}. \nIf the project was moved re-run 'source bootstrap.sh'" >&2
fi
}
function berseker_build() {
__check_and_run_berseker_script build.sh "$@"
}
function berseker_cleanup() {
__check_and_run_berseker_script cleanup.sh "$@"
}
function berseker_run() {
__check_and_run_berseker_script run.sh "$@"
}
function berseker_reload_shaders() {
__check_and_run_berseker_script shader_resources_generator.py "$@"
}