|
@@ -1,9 +1,32 @@
|
1
|
1
|
#!/bin/bash
|
2
|
2
|
|
3
|
|
-. "$MKIT_DIR/include/build.sh" || die "cannot import build.sh"
|
4
|
|
-. "$MKIT_DIR/include/deploy.sh" || die "cannot import deploy.sh"
|
5
|
|
-. "$MKIT_DIR/include/release.sh" || die "cannot import release.sh"
|
6
|
|
-. "$MKIT_DIR/include/ini.sh" || die "cannot import ini.sh"
|
|
3
|
+die() {
|
|
4
|
+ #
|
|
5
|
+ # Exit with message and non-zero exit status
|
|
6
|
+ #
|
|
7
|
+ echo "fatal: $*" >&2
|
|
8
|
+ exit 4
|
|
9
|
+}
|
|
10
|
+
|
|
11
|
+mkit_import() {
|
|
12
|
+ #
|
|
13
|
+ # Import mkit module $1.sh
|
|
14
|
+ #
|
|
15
|
+ # Check for module, source it and die with reasonable message if needed.
|
|
16
|
+ #
|
|
17
|
+ local modname=$1
|
|
18
|
+ local modpath
|
|
19
|
+ modpath="$MKIT_DIR/include/$modname.sh"
|
|
20
|
+ test -f "$modpath" || die "no such module: $modpath"
|
|
21
|
+ bash -n "$modpath" || die "bad syntax: $modpath"
|
|
22
|
+ #shellcheck disable=SC1090
|
|
23
|
+ . "$modpath" || die "failed to import: $modname"
|
|
24
|
+}
|
|
25
|
+
|
|
26
|
+mkit_import build
|
|
27
|
+mkit_import deploy
|
|
28
|
+mkit_import release
|
|
29
|
+mkit_import ini
|
7
|
30
|
|
8
|
31
|
_valid_targets() {
|
9
|
32
|
#
|
|
@@ -49,14 +72,6 @@ debug_var() {
|
49
|
72
|
done
|
50
|
73
|
}
|
51
|
74
|
|
52
|
|
-die() {
|
53
|
|
- #
|
54
|
|
- # Exit with message and non-zero exit status
|
55
|
|
- #
|
56
|
|
- echo "fatal: $*" >&2
|
57
|
|
- exit 4
|
58
|
|
-}
|
59
|
|
-
|
60
|
75
|
_compver() {
|
61
|
76
|
#
|
62
|
77
|
# True if version $1 matches our version
|