Skip to content

Commit ceea480

Browse files
committed
chore: Fix load.bash yet again
The format of load.bash is changing yet again to be more extensible
1 parent 38552aa commit ceea480

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

load.bash

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
# shellcheck shell=bash
22

3-
# TODO: autogen by basalt
4-
if [ -z "$BASALT_PACKAGE_PATH" ]; then
5-
if [ "${BASH_SOURCE[0]::1}" = / ]; then
6-
BASALT_PACKAGE_PATH="${BASH_SOURCE[0]%/*}"
7-
else
8-
BASALT_PACKAGE_PATH="$(CDPATH=; cd "${BASH_SOURCE[0]%/*}" &>/dev/null; printf "$PWD")"
9-
fi
10-
fi
11-
12-
for f in "$BASALT_PACKAGE_PATH"/pkg/lib/{,source/,util/}?*.sh; do
13-
source "$f"
14-
done
3+
basalt.load() {
4+
for f in "$BASALT_PACKAGE_PATH"/pkg/lib/{,source/,util/}?*.sh; do
5+
source "$f"
6+
done
7+
}

tests/util/init.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# TODO: test for -u and -o pipefail
44
set -e
55

6+
basalt-package-init
7+
eval "$(basalt-package-init)"; basalt-package.init
8+
# basalt-package.load_dependencies
9+
610
load '../load.bash'
711
load './util/test_util.sh'
812

9-
eval "$(basalt global init bash)"
10-
basalt-load 'github.com/ztombol/bats-support'
11-
basalt-load 'github.com/ztombol/bats-assert'
12-
1313
setup() {
1414
cd "$BATS_TEST_TMPDIR"
1515
}

0 commit comments

Comments
 (0)