There were some cases where exit is not being called and other cases where exit 0 is being called.
Make sure that exit 1 is called on error so that this script can then be scriptable.
if [[ ! -d $path_c && ( ${variables[$(generate_id build_sources_library)]} != "" || ${variables[$(generate_id build_sources_program)]} != "" || ${variables[$(generate_id build_sources_headers)]} != "" ) ]] ; then
echo -e "${c_error}ERROR: the c path of '$c_notice$path_c$c_error' is invalid.$c_reset"
generate_cleanup
- exit 0
+ exit 1
fi
if [[ $operation_failure == "fail-multiple" ]] ; then
echo -e "${c_error}ERROR: only one operation may be specified at a time.$c_reset"
+ exit 1
elif [[ $operation == "build" ]] ; then
if [[ -f ${path_build}.built$project_built ]] ; then
echo -e "${c_warning}WARNING: this project has already been built.$c_reset"
generate_operation_clean
elif [[ $operation == "" ]] ; then
echo -e "${c_error}ERROR: no operation was given.$c_reset"
+ exit 1
else
echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ exit 1
fi
}
if [[ $operation_failure == "fail-unsupported" ]] ; then
echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ exit 1
else
if [[ $prefix == "" && ! -d $path_build ]] ; then
echo -e "${c_error}ERROR: the build path $c_notice$path_build$c_error is not a valid directory.$c_reset"
if [[ $operation_failure == "fail-multiple" ]] ; then
echo -e "${c_error}ERROR: only one operation may be specified at a time.$c_reset"
+ exit 1
elif [[ $operation == "build" ]] ; then
if [[ $mode_individual == "" && $mode_level == "" && $mode_monolithic == "" && $mode_program == "" ]] ; then
mode_individual="yes"
package_operation_clean
elif [[ $operation == "" ]] ; then
echo -e "${c_error}ERROR: no operation was given.$c_reset"
+ exit 1
else
echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ exit 1
fi
}