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:
parent
ea2dc1bd93
commit
7ec6dc98c9
6 changed files with 30 additions and 36 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
11
theme_rofi
11
theme_rofi
|
@ -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"
|
||||
|
|
11
theme_shell
11
theme_shell
|
@ -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"
|
||||
|
|
11
theme_vim
11
theme_vim
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue