armbian-next: extensions: move 'extensions.sh' into library; replace manual source with init function

- wraps globals in `extension_manager_declare_globals()` -- and make them actually global
- whoever wrote this original code is insane, add copyright
This commit is contained in:
Ricardo Pardini
2023-01-21 05:15:19 +01:00
parent 092f9ad3b2
commit eb30aac310
5 changed files with 39 additions and 22 deletions

View File

@@ -131,10 +131,9 @@ function cli_entrypoint() {
fi
fi
# Source the extensions manager library at this point, before sourcing the config.
# This allows early calls to enable_extension(), but initialization proper is done later.
# shellcheck source=lib/extensions.sh
source "${SRC}"/lib/extensions.sh
# Legacy. We used to source the extension manager here, but now it's included in the library.
# @TODO: a quick check on the globals in extensions.sh would get rid of this.
extension_manager_declare_globals
# Loop over the ARMBIAN_CONFIG_FILES array and source each. The order is important.
for config_file in "${ARMBIAN_CONFIG_FILES[@]}"; do