- core/framework/: flag.sh, hook.sh, help.sh, command.sh, mixin.sh - core/app/: wgctl-specific context.sh, json.sh - core/framework/mixins/: json_output, no_color mixins - core/core.sh: sources framework/core.sh + app/core.sh - PYTHONPATH exported in app/core.sh for lib/ module resolution - command::_load_mixins: uses _FRAMEWORK_DIR for mixin path
20 lines
No EOL
496 B
Bash
20 lines
No EOL
496 B
Bash
#!/usr/bin/env bash
|
|
|
|
_APP_CORE_DIR="$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
# ============================================
|
|
# Core Bootstrap
|
|
# ============================================
|
|
|
|
source "${_APP_CORE_DIR}/context.sh"
|
|
source "${_APP_CORE_DIR}/json.sh"
|
|
|
|
export PYTHONPATH="$(ctx::core):${PYTHONPATH:-}"
|
|
|
|
function app::_load_mixins() {
|
|
local mixin_file
|
|
for mixin_file in "${WGCTL_DIR}/commands/mixins/"*.mixin.sh; do
|
|
[[ -f "$mixin_file" ]] && source "$mixin_file"
|
|
done
|
|
}
|
|
app::_load_mixins |