From cb736e1edf7b861ea7e339428a4c9accc0aec021 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Tue, 14 Feb 2023 12:08:17 +0900 Subject: [PATCH] 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. --- toolbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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" -- 2.47.3