2018-03-28 13:52:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
EXEC=dam
|
2018-04-08 01:02:31 +00:00
|
|
|
gen_help() {
|
|
|
|
for file in $(find help/ -type f -printf "%P\n"); do
|
|
|
|
echo -e "
|
|
|
|
# ${file} help
|
|
|
|
help_${file}() {
|
|
|
|
echo -e \""
|
|
|
|
cat help/${file}
|
|
|
|
echo -e "\"
|
|
|
|
}"
|
|
|
|
done
|
2018-03-28 13:52:57 +00:00
|
|
|
|
2018-04-08 01:02:31 +00:00
|
|
|
}
|
2018-03-28 13:52:57 +00:00
|
|
|
|
2018-04-08 01:02:31 +00:00
|
|
|
gen_env() {
|
|
|
|
echo -e "#!/bin/bash\n"
|
|
|
|
echo "VERSION=$(git describe --tags)"
|
|
|
|
awk '!/^ *#/ && NF' src/env
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_function() {
|
|
|
|
functionList=(${@})
|
|
|
|
for function in ${functionList[@]}; do
|
|
|
|
awk '!/^ *#/ && NF' ${function}
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_parser() {
|
|
|
|
awk '!/^ *#/ && NF' src/parser
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_env > ${EXEC}
|
|
|
|
gen_help >> ${EXEC}
|
|
|
|
gen_function $(find src/ -type f -not -name env -not -name parser) >> ${EXEC}
|
|
|
|
gen_function $(find bunc/src/ -type f) >> ${EXEC}
|
|
|
|
gen_parser >> ${EXEC}
|
2018-03-28 23:26:38 +00:00
|
|
|
|
2018-04-07 23:58:45 +00:00
|
|
|
chmod +x ${EXEC}
|