From 16e086739d2629f77071ac0de5d6e6cd1bd8b8df Mon Sep 17 00:00:00 2001 From: fabolous005 Date: Sat, 5 Oct 2024 16:53:52 +0200 Subject: [PATCH] allow soucing using full path specifier --- etools | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/etools b/etools index f44ecbe..19d4223 100644 --- a/etools +++ b/etools @@ -4,7 +4,13 @@ # NOTE: parse config, gets run when sourced function etools_configure() { - ETOOLS_DIR="$PWD/$(dirname "${BASH_SOURCE[0]}")" + local location= + location=$(dirname "${BASH_SOURCE[0]}") + if [[ "$location" == /* ]]; then + ETOOLS_DIR=$location + else + ETOOLS_DIR="$PWD/$location" + fi . "$ETOOLS_DIR"/config.sh _configure "$ETOOLS_DIR"/config.sh @@ -44,6 +50,7 @@ function etools_smart_find() { # NOTE: get latest enabled version for a given package name function etools_get_version() { [ -z "$1" ] && eerror "Pass a package name to this function" "\n" && return 2; + # WARN: turns out ir doesn't # in this case globs work with -d # shellcheck disable=SC2144 [ ! -d "${ETOOLS_REPO_PATH}"/*/"$1" ] && \