2023-11-23 09:52:16 -05:00
|
|
|
#!/bin/bash
|
2023-11-28 11:54:48 -05:00
|
|
|
#
|
|
|
|
# This script has been created as part of the Blueprint source code
|
|
|
|
# and may be intergrated directly into the core in the future.
|
2023-11-23 09:52:16 -05:00
|
|
|
|
2023-12-17 07:43:59 -05:00
|
|
|
source "${BLUEPRINT__FOLDER}/.blueprint/lib/bash_colors.sh"
|
2023-11-23 09:52:16 -05:00
|
|
|
|
2023-11-24 06:14:48 -05:00
|
|
|
function throwError {
|
2023-12-11 07:55:52 -05:00
|
|
|
if [[ $1 == "cdMissingDirectory" ]]; then err="Tried to navigate to a directory that does not exist, halting process.";fi
|
|
|
|
if [[ $1 == "confymlNotFound" ]]; then err="Could not find a conf.yml file.";fi
|
2023-12-11 08:32:32 -05:00
|
|
|
if [[ $1 == "confymlMissingFiles" ]]; then err="A conf.yml value is pointing to a file that does not exist.";fi
|
2023-12-11 07:55:52 -05:00
|
|
|
if [[ $1 == "scriptsMissingFiles" ]]; then err="Could not find install/remove/export script even though it's enabled.";fi
|
2023-12-11 10:13:53 -05:00
|
|
|
if [[ $1 == "scriptsNoDataDir" ]]; then err="Could not run extension's install/remove/export script as the extension does not have a data directory.";fi
|
2023-12-22 10:06:02 -05:00
|
|
|
if [[ $1 == "debugLineCount" ]]; then err="Provide the amount of debug lines to print as an argument, which must be greater than one (1).";fi
|
2023-11-23 09:52:16 -05:00
|
|
|
|
2023-11-23 09:59:30 -05:00
|
|
|
if [[ $err == "" ]]; then err="$1"; fi
|
2023-11-23 09:52:16 -05:00
|
|
|
log_red "[FATAL] $err"
|
|
|
|
return 1
|
2023-11-30 17:12:11 -05:00
|
|
|
}
|
2023-12-22 10:06:02 -05:00
|
|
|
|
2023-11-30 17:12:11 -05:00
|
|
|
function throwByte {
|
|
|
|
# [ ^^] ello
|
|
|
|
if [[ $err == "" ]]; then err="$1"; fi
|
|
|
|
log_blue "[ " log_white "^^" log_blue "] $err"
|
|
|
|
return 1
|
2023-11-23 09:52:16 -05:00
|
|
|
}
|