Skip to content

Commit 225232d

Browse files
committed
Bash-Lib functions are exported to sub-shells
This allows an initial script to source bash-lib/init and all functions be available to all sub scripts. Related: conjurinc/ops#423
1 parent ea7df63 commit 225232d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

init

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ for lib in helpers logging filehandling git k8s test-utils; do
2424
. "${BASH_LIB_DIR_RELATIVE}/${lib}/lib"
2525
done
2626

27+
# Export functions to subshells
28+
eval "$(declare -F | sed -e 's/-f /-fx /')"
29+
2730
# Export the absolute path
2831
# shellcheck disable=SC2086
2932
BASH_LIB_DIR="$(abs_path ${BASH_LIB_DIR_RELATIVE})"

0 commit comments

Comments
 (0)