Skip to content

Commit 73bfa7c

Browse files
committed
fix: Cleanup
1 parent b280f3b commit 73bfa7c

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

pkg/lib/cmd/bpm-load.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ bpm-load() {
110110
fi
111111
done
112112

113-
# sleep 2000
114113
if [ "$__bpm_file_was_sourced" = 'no' ]; then
115114
printf '%s\n' "bpm-load: Error: Could not automatically find package file to source"
116115
__bpm_bpm_load_restore_options
@@ -124,13 +123,13 @@ bpm-load() {
124123
# @description Restore the previous options
125124
# @noargs
126125
__bpm_bpm_load_restore_options() {
127-
if [ "$__bpm_setNullglob" ]; then
126+
if [ "$__bpm_setNullglob" = 'yes' ]; then
128127
shopt -s nullglob
129128
else
130129
shopt -u nullglob
131130
fi
132131

133-
if [ "$__bpm_setExtglob" ]; then
132+
if [ "$__bpm_setExtglob" = 'yes' ]; then
134133
shopt -s extglob
135134
else
136135
shopt -u extglob

tests/do-init.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ load './util/init.sh'
1111
assert test_util.is_exported 'BPM_ROOT'
1212
}
1313

14-
1514
@test "exports BPM_CELLAR" {
16-
BPM_CELLAR=/lol run do-init bash
15+
unset BPM_ROOT
16+
eval "$(BPM_CELLAR=/lol do-init bash)"
1717

1818
assert_success
19-
assert_line -p 'export BPM_CELLAR="/lol"'
19+
assert [ "$BPM_CELLAR" = '/lol' ]
20+
assert test_util.is_exported 'BPM_CELLAR'
2021
}
2122

22-
2323
@test "errors if shell is not available" {
2424
run do-init fakesh
2525

tests/util/test_util.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,6 @@ test_util.is_exported() {
2020
esac
2121

2222
return 1
23-
24-
# if declare -x | while read -r line; do
25-
# case "$line" in
26-
# "declare -x $variable_name"=*) return 10 ;;
27-
# esac
28-
# done; then
29-
# return 1
30-
# else
31-
# if (($? == 10)); then
32-
# return 0
33-
# else
34-
# return 1
35-
# fi
36-
# fi
3723
fi
3824
}
3925

0 commit comments

Comments
 (0)