[build] Added ability to specify dependent functions
This commit is contained in:
parent
b179b90d83
commit
b45c5a8e6b
2 changed files with 7 additions and 6 deletions
9
build.sh
9
build.sh
|
@ -3,9 +3,13 @@
|
||||||
EXEC=dam
|
EXEC=dam
|
||||||
|
|
||||||
test_function() {
|
test_function() {
|
||||||
functionList=(${@})
|
local functionList=(${@})
|
||||||
source src/env
|
source src/env
|
||||||
for function in ${functionList[@]}; do
|
for function in ${functionList[@]}; do
|
||||||
|
local dependencyList=($(grep "# DEPENDENCIES" ${function} | sed 's|# DEPENDENCIES||'))
|
||||||
|
for dependency in ${dependencyList[@]}; do
|
||||||
|
eval source ${dependency}
|
||||||
|
done
|
||||||
bash ${function}
|
bash ${function}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -30,7 +34,7 @@ gen_env() {
|
||||||
}
|
}
|
||||||
|
|
||||||
gen_function() {
|
gen_function() {
|
||||||
functionList=(${@})
|
local functionList=(${@})
|
||||||
for function in ${functionList[@]}; do
|
for function in ${functionList[@]}; do
|
||||||
awk '!/^ *#/ && NF' ${function}
|
awk '!/^ *#/ && NF' ${function}
|
||||||
done
|
done
|
||||||
|
@ -41,6 +45,7 @@ gen_parser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
test_function $(find src/ -type f -not -name env -not -name parser)
|
test_function $(find src/ -type f -not -name env -not -name parser)
|
||||||
|
# test_function src/import_track
|
||||||
|
|
||||||
gen_env > ${EXEC}
|
gen_env > ${EXEC}
|
||||||
gen_help >> ${EXEC}
|
gen_help >> ${EXEC}
|
||||||
|
|
|
@ -16,8 +16,4 @@ import_dir() {
|
||||||
|
|
||||||
local trackList=($(find ${TRACK_DIR} -maxdepth=1 -name *.flac -print '%p\t'))
|
local trackList=($(find ${TRACK_DIR} -maxdepth=1 -name *.flac -print '%p\t'))
|
||||||
|
|
||||||
for track in ${trackList[@]}; do
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue