30 lines
890 B
Bash
Executable file
30 lines
890 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# this is the main script template
|
|
|
|
set -eo pipefail #these can cause problems when you want stuff to keep going
|
|
|
|
if [[ -n "${BASHD_DEBUG}" ]]; then # a inevitability that this will be used
|
|
set -x
|
|
fi
|
|
|
|
trap cleanup EXIT # A little more robust cleanup
|
|
|
|
# trap errors and set the ERR trap
|
|
trap 'echo -e "\nERROR: $BASH_COMMAND\nFILE: ${BASH_SOURCE[0]}\nLINE: ${BASH_LINENO[0]}\n" >&2; exit 1' ERR
|
|
|
|
cleanup() {
|
|
# We can clean up any temp files or what nots, but for now a place holder
|
|
true
|
|
}
|
|
|
|
source ./modules/config_json.bash # can be json or ini, I preffer json
|
|
source ./modules/init_project.bash
|
|
version=$(read_json "$JSON_FILE" "lactozora" "version")
|
|
echo "Lactozora version: $version"
|
|
#
|
|
if [ -n "$1" ]; then
|
|
init_project "$1"
|
|
else
|
|
echo "The lactozora bash framework. Feed this script a project directory to initialize it. That is all this script does."
|
|
fi
|