From: Matthias Kruk Date: Tue, 14 Feb 2023 03:08:17 +0000 (+0900) Subject: toolbox: Allow inclusion of test modules when running in shellspec X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=cb736e1edf7b861ea7e339428a4c9accc0aec021;p=toolbox toolbox: Allow inclusion of test modules when running in shellspec Toolbox fails to set the module search paths correctly when running in shellspec, rendering test cases unable to include modules from test/include. This commit modifies toolbox to prepend test/include to the module search path array when executed in shellspec. --- diff --git a/toolbox.sh b/toolbox.sh index f8549e2..f035042 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -1,7 +1,7 @@ #!/bin/bash # toolbox.sh - Framework for modular bash scripts -# Copyright (C) 2021-2022 Matthias Kruk +# Copyright (C) 2021-2023 Matthias Kruk # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,6 +38,7 @@ __toolbox_init() { declare -gxr TOOLBOX_PATH="$toolboxroot" declare -gxr TOOLBOX_HOME="$HOME/.toolbox" declare -axgr __TOOLBOX_MODULEPATH=( + ${SHELLSPEC_PROJECT_ROOT:+"$SHELLSPEC_PROJECT_ROOT/test/include"} "$scriptroot/include" "$TOOLBOX_HOME/include" "$toolboxroot/include"