forked from Samsung/ONE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nnfw
executable file
·41 lines (31 loc) · 788 Bytes
/
nnfw
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
#!/bin/bash
NNFW_SCRIPT_RPATH="infra/nnfw"
NNFW_COMMAND_RPATH="${NNFW_SCRIPT_RPATH}/command"
NNFW_PROJECT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
NNFW_SCRIPT_PATH="${NNFW_PROJECT_PATH}/${NNFW_SCRIPT_RPATH}"
function Usage()
{
echo "Usage: $0 [COMMAND] ..."
echo "Command:"
for file in "$NNFW_COMMAND_RPATH"/*;
do
echo " $(basename "$file")"
done
}
COMMAND=$1; shift
if [[ -z "${COMMAND}" ]]; then
Usage
exit 255
fi
COMMAND_FILE="${NNFW_PROJECT_PATH}/${NNFW_COMMAND_RPATH}/${COMMAND}"
if [[ ! -f "${COMMAND_FILE}" ]]; then
echo "ERROR: '${COMMAND}' is not supported"
exit 255
fi
export NNFW_PROJECT_PATH
export NNFW_SCRIPT_PATH
function import()
{
source "${NNFW_PROJECT_PATH}/${NNFW_SCRIPT_RPATH}/config/$1"
}
source "${COMMAND_FILE}" "$@"