-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathframework.sh
46 lines (34 loc) · 975 Bytes
/
framework.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
set -e
shopt -s extglob expand_aliases
pushd "${BASH_SOURCE%/*}" >/dev/null
FRAMEWORK_CWD=$(pwd)
. ./standalone/constants.sh
. ./standalone/console.sh
. ./lib/string.sh
. ./platform.sh
. ./registry/require.sh
. ./registry/trap.sh
. ./registry/command.sh
. ./registry/help.sh
. ./registry/installer.sh
. ./registry/flow.sh
popd >/dev/null
SYSTEM_IMPORT_LIST=""
function System::Bootstrap() {
Registry::checkRequirements "${@}"
}
function System::import() {
local dependency=${1##+(.|/)}
shift || true
# shellcheck disable=SC1090
if [[ "${SYSTEM_IMPORT_LIST}" != *";${dependency};"* ]]; then
SYSTEM_IMPORT_LIST="${SYSTEM_IMPORT_LIST};${dependency};"
source "${FRAMEWORK_CWD}/${dependency}" "${@}"
fi
}
alias require="Registry::require"
alias require:linux="Registry::requireLinux"
alias require:macos="Registry::requireMacos"
alias require:windows="Registry::requireWindows"
alias import="System::import"