Zuletzt aktiv 1 month ago

nuno hat die Gist bearbeitet 1 month ago. Zu Änderung gehen

1 file changed, 20 insertions

gistfile1.txt(Datei erstellt)

@@ -0,0 +1,20 @@
1 + function load_module() {
2 + local name="$1"
3 +
4 + module::loaded "$name" && return 0
5 +
6 + local path
7 + path="$(ctx::modules)/${name}.module.sh"
8 +
9 + if [[ ! -f "$path" ]]; then
10 + log::error "Module not found: ${name} (${path})"
11 + return 1
12 + fi
13 +
14 + source "$path"
15 + _LOADED_MODULES["$name"]=1
16 +
17 + core::call_if_exists "$(module::fn "$name" on_load)"
18 +
19 + return 0
20 + }
Neuer Älter