diff --git a/example_template b/example_template index a63409c..57975d5 100644 --- a/example_template +++ b/example_template @@ -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" diff --git a/theme_qutebrowser b/theme_qutebrowser index 7109b1f..de10f63 100755 --- a/theme_qutebrowser +++ b/theme_qutebrowser @@ -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" diff --git a/theme_rofi b/theme_rofi index 9ded370..f549eaf 100755 --- a/theme_rofi +++ b/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" diff --git a/theme_shell b/theme_shell index b52c688..ee3a950 100755 --- a/theme_shell +++ b/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" diff --git a/theme_vim b/theme_vim index ed43e6f..7818a37 100755 --- a/theme_vim +++ b/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" diff --git a/theme_xresources b/theme_xresources index 347c41e..dd2df70 100755 --- a/theme_xresources +++ b/theme_xresources @@ -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"