diff --git a/compile.sh b/compile.sh index 11b6edf20..6d62a3a2d 100755 --- a/compile.sh +++ b/compile.sh @@ -27,15 +27,15 @@ if [[ "${ARMBIAN_ENABLE_CALL_TRACING}" == "yes" ]]; then trap 'echo "${BASH_LINENO[@]}|${BASH_SOURCE[@]}|${FUNCNAME[@]}" >> ${SRC}/output/debug/calls.txt ;' RETURN fi -if [[ -f "${SRC}"/lib/general.sh ]]; then +if [[ -f "${SRC}"/lib/import-functions.sh ]]; then # Declare this folder as safe if ! grep -q 2>/dev/null "directory = \*" "$HOME/.gitconfig"; then git config --global --add safe.directory "*" fi - # shellcheck source=lib/general.sh - source "${SRC}"/lib/general.sh + # shellcheck source=lib/import-functions.sh + source "${SRC}"/lib/import-functions.sh else diff --git a/lib/import-functions.sh b/lib/import-functions.sh new file mode 100644 index 000000000..07ac30ede --- /dev/null +++ b/lib/import-functions.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +while read -r file; do + # shellcheck source=/dev/null + source "$file" +done <<<"$(find "${SRC}/lib/functions" -name "*.sh")" diff --git a/lib/main.sh b/lib/main.sh index d4b50cd15..7b7630383 100644 --- a/lib/main.sh +++ b/lib/main.sh @@ -61,6 +61,8 @@ backtitle="Armbian building script, https://www.armbian.com | https://docs.armbi [[ -z $CONSOLE_CHAR ]] && export CONSOLE_CHAR="UTF-8" # set console to UTF-8 if not set # Libraries include +# shellcheck source=import-functions.sh +source "${SRC}/lib/import-functions.sh" # shellcheck source=debootstrap.sh source "${SRC}"/lib/debootstrap.sh # system specific install