File tree Expand file tree Collapse file tree 6 files changed +31
-88
lines changed Expand file tree Collapse file tree 6 files changed +31
-88
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ # shellcheck shell=bash
2
+
3
+ bobject-print () {
4
+ # TODO
5
+ :
6
+ }
Original file line number Diff line number Diff line change 1
1
# shellcheck shell=bash
2
2
3
- for f in " $BASH_OBJECT_LIB_DIR " /{,util/}?* .sh; do
4
- source " $f "
5
- done
6
-
7
3
bobject () {
8
4
local subcmd=" $1 "
9
5
shift
Original file line number Diff line number Diff line change
1
+ # shellcheck shell=bash
2
+
3
+ # TODO: autogen by basalt?
4
+
5
+ if [ -z " $BASALT_PACKAGE_PATH " ]; then
6
+ if [ " ${BASH_SOURCE[0]:: 1} " = / ]; then
7
+ BASALT_PACKAGE_PATH=" ${BASH_SOURCE[0]} "
8
+ elif command -v greadlink & > /dev/null; then
9
+ BASALT_PACKAGE_PATH=" $( greadlink -f " ${BASH_SOURCE[0]} " ) "
10
+ elif command -v realfile & > /dev/null; then
11
+ BASALT_PACKAGE_PATH=" $( realfile " ${BASH_SOURCE[0]} " ) "
12
+ elif command -v readlink & > /dev/null; then
13
+ BASALT_PACKAGE_PATH=" $( readlink -f " ${BASH_SOURCE[0]} " ) "
14
+ fi
15
+
16
+ BASALT_PACKAGE_PATH=" ${BASALT_PACKAGE_PATH%/* } "
17
+ BASALT_PACKAGE_PATH=" ${BASALT_PACKAGE_PATH%/* } "
18
+ fi
19
+
20
+ for f in " $BASALT_PACKAGE_PATH " /pkg/lib/{,source/,util/}?* .sh; do
21
+ source " $f "
22
+ done
Original file line number Diff line number Diff line change 1
1
# shellcheck shell=bash
2
2
3
+ # TODO: test for -u and -o pipefail
3
4
set -e
4
5
5
- # TODO: only do once
6
- eval " $( basalt global init bash) "
7
-
6
+ load ' ../pkg/load.bash'
8
7
load ' ./util/test_util.sh'
9
8
9
+ eval " $( basalt global init bash) "
10
10
basalt-load ' github.com/ztombol/bats-support'
11
11
basalt-load ' github.com/ztombol/bats-assert'
12
12
13
- # TODO
14
- ROOT_DIR=" $( realpath " ${BASH_SOURCE[0]} " ) "
15
- ROOT_DIR=" ${ROOT_DIR%/* } " ; ROOT_DIR=" ${ROOT_DIR%/* } " ; ROOT_DIR=" ${ROOT_DIR%/* } "
16
-
17
- export PATH=" $ROOT_DIR /pkg/bin:$PATH "
18
- for f in " $ROOT_DIR " /pkg/lib/{,util}/?* .sh; do
19
- # shellcheck disable=SC1090
20
- source " $f "
21
- done
22
- source ' bobject'
23
-
24
13
setup () {
25
14
cd " $BATS_TEST_TMPDIR "
26
15
}
You can’t perform that action at this time.
0 commit comments