diff --git a/theme_qutebrowser b/theme_qutebrowser index a667858..7109b1f 100755 --- a/theme_qutebrowser +++ b/theme_qutebrowser @@ -7,12 +7,6 @@ readonly package="$2" readonly theme="$3" readonly permanent="$4" -# 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 Entrypoint # # Finds the right theme template file and starts theme @@ -88,6 +82,12 @@ include() { # 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"