Add lib/import-functions.sh to import functions

Note: build will fail on this commit
This commit is contained in:
hzy
2022-10-03 10:51:44 +08:00
committed by Ricardo Pardini
parent 3ee0c015cd
commit 14f4260bf9
3 changed files with 11 additions and 3 deletions

View File

@@ -27,15 +27,15 @@ if [[ "${ARMBIAN_ENABLE_CALL_TRACING}" == "yes" ]]; then
trap 'echo "${BASH_LINENO[@]}|${BASH_SOURCE[@]}|${FUNCNAME[@]}" >> ${SRC}/output/debug/calls.txt ;' RETURN trap 'echo "${BASH_LINENO[@]}|${BASH_SOURCE[@]}|${FUNCNAME[@]}" >> ${SRC}/output/debug/calls.txt ;' RETURN
fi fi
if [[ -f "${SRC}"/lib/general.sh ]]; then if [[ -f "${SRC}"/lib/import-functions.sh ]]; then
# Declare this folder as safe # Declare this folder as safe
if ! grep -q 2>/dev/null "directory = \*" "$HOME/.gitconfig"; then if ! grep -q 2>/dev/null "directory = \*" "$HOME/.gitconfig"; then
git config --global --add safe.directory "*" git config --global --add safe.directory "*"
fi fi
# shellcheck source=lib/general.sh # shellcheck source=lib/import-functions.sh
source "${SRC}"/lib/general.sh source "${SRC}"/lib/import-functions.sh
else else

6
lib/import-functions.sh Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
while read -r file; do
# shellcheck source=/dev/null
source "$file"
done <<<"$(find "${SRC}/lib/functions" -name "*.sh")"

View File

@@ -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 [[ -z $CONSOLE_CHAR ]] && export CONSOLE_CHAR="UTF-8" # set console to UTF-8 if not set
# Libraries include # Libraries include
# shellcheck source=import-functions.sh
source "${SRC}/lib/import-functions.sh"
# shellcheck source=debootstrap.sh # shellcheck source=debootstrap.sh
source "${SRC}"/lib/debootstrap.sh # system specific install source "${SRC}"/lib/debootstrap.sh # system specific install