Fix utility sourcing

Utilities should always be sourced, even in the case that the processor
is not designated for any of the templates provided.
This commit is contained in:
Marty Oehme 2020-02-15 15:25:20 +01:00
parent ea2dc1bd93
commit 7ec6dc98c9
No known key found for this signature in database
GPG Key ID: 0CCB0526EFB9611A
6 changed files with 30 additions and 36 deletions

View File

@ -58,17 +58,16 @@ include() {
dbg_msg $app "Sucessfully included theme"
}
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
## Dependency Checker
#
# Makes sure the processor is called for the correct
# base16 package, or refuses to run if it is not.
if printf '%s\n' "${dependency[@]}" | grep -q -P "^$package$"; then
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
main
else
dbg_msg $app "error" "Processor does not work for package $package"

View File

@ -77,17 +77,16 @@ include() {
fi
}
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
## Dependency Checker
#
# Makes sure the processor is called for the correct
# base16 package, or refuses to run if it is not.
if printf '%s\n' "${dependency[@]}" | grep -q -P "^$package$"; then
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
main
else
dbg_msg $app "error" "Processor does not work for package $package"

View File

@ -73,17 +73,16 @@ include() {
dbg_msg $app "Sucessfully included theme"
}
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
## Dependency Checker
#
# Makes sure the processor is called for the correct
# base16 package, or refuses to run if it is not.
if printf '%s\n' "${dependency[@]}" | grep -q -P "^$package$"; then
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
main
else
dbg_msg $app "error" "Processor does not work for package $package"

View File

@ -66,17 +66,16 @@ theme() {
# dbg_msg $app "Sucessfully included theme"
#}
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
## Dependency Checker
#
# Makes sure the processor is called for the correct
# base16 package, or refuses to run if it is not.
if printf '%s\n' "${dependency[@]}" | grep -q -P "^$package$"; then
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
main
else
dbg_msg $app "error" "Processor does not work for package $package"

View File

@ -98,17 +98,16 @@ include() {
fi
}
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
## Dependency Checker
#
# Makes sure the processor is called for the correct
# base16 package, or refuses to run if it is not.
if printf '%s\n' "${dependency[@]}" | grep -q -P "^$package$"; then
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
main
else
dbg_msg $app "error" "Processor does not work for package $package"

View File

@ -86,17 +86,16 @@ include() {
fi
}
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
## Dependency Checker
#
# Makes sure the processor is called for the correct
# base16 package, or refuses to run if it is not.
if printf '%s\n' "${dependency[@]}" | grep -q -P "^$package$"; then
# Safe sourcing: https://stackoverflow.com/a/12694189
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# shellcheck source=utilities.sh
. "$DIR/utilities.sh"
main
else
dbg_msg $app "error" "Processor does not work for package $package"