[build] Added ability to specify dependent functions

This commit is contained in:
ayakael 2018-05-18 13:12:49 -07:00
parent b179b90d83
commit b45c5a8e6b
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026
2 changed files with 7 additions and 6 deletions

View file

@ -3,9 +3,13 @@
EXEC=dam
test_function() {
functionList=(${@})
local functionList=(${@})
source src/env
for function in ${functionList[@]}; do
local dependencyList=($(grep "# DEPENDENCIES" ${function} | sed 's|# DEPENDENCIES||'))
for dependency in ${dependencyList[@]}; do
eval source ${dependency}
done
bash ${function}
done
}
@ -30,7 +34,7 @@ gen_env() {
}
gen_function() {
functionList=(${@})
local functionList=(${@})
for function in ${functionList[@]}; do
awk '!/^ *#/ && NF' ${function}
done
@ -41,6 +45,7 @@ gen_parser() {
}
test_function $(find src/ -type f -not -name env -not -name parser)
# test_function src/import_track
gen_env > ${EXEC}
gen_help >> ${EXEC}

View file

@ -16,8 +16,4 @@ import_dir() {
local trackList=($(find ${TRACK_DIR} -maxdepth=1 -name *.flac -print '%p\t'))
for track in ${trackList[@]}; do
done
}