Skip to content

Commit 65558d7

Browse files
committed
fix: Use 'BPM_REPO_ROOT' variable in init
1 parent 1eded02 commit 65558d7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

pkg/lib/commands/do-init.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ echo_bpm_variables_posix() {
44
cat <<-EOF
55
# bpm variables
66
export BPM_ROOT="$BPM_ROOT"
7+
export BPM_REPO_ROOT="$BPM_ROOT/source"
78
export BPM_PREFIX="$BPM_PREFIX"
89
export BPM_PACKAGES_PATH="$BPM_PACKAGES_PATH"
910
@@ -13,8 +14,8 @@ echo_bpm_variables_posix() {
1314
echo_bpm_include_posix() {
1415
cat <<-"EOF"
1516
# bpm include function
16-
if [ -f "$BPM_ROOT/source/pkg/share/include.sh" ]; then
17-
. "$BPM_ROOT/source/pkg/share/include.sh"
17+
if [ -f "$BPM_REPO_ROOT/pkg/share/include.sh" ]; then
18+
. "$BPM_REPO_ROOT/pkg/share/include.sh"
1819
fi
1920
2021
EOF
@@ -53,15 +54,16 @@ do-init() {
5354
cat <<-EOF
5455
# bpm variables
5556
set -gx BPM_ROOT $BPM_ROOT
57+
set -gx BPM_REPO_ROOT $BPM_ROOT/source
5658
set -gx BPM_PREFIX $BPM_PREFIX
5759
set -gx BPM_PACKAGES_PATH $BPM_PACKAGES_PATH
5860
5961
# bpm completion
60-
source \$BPM_ROOT/source/completions/bpm.fish
62+
source \$BPM_REPO_ROOT/completions/bpm.fish
6163
6264
# bpm include function
63-
if [ -f "$BPM_ROOT/source/pkg/share/include.fish" ]
64-
source "$BPM_ROOT/source/pkg/share/include.fish"
65+
if [ -f "$BPM_REPO_ROOT/pkg/share/include.fish" ]
66+
source "$BPM_REPO_ROOT/pkg/share/include.fish"
6567
end
6668
6769
# bpm packages PATH
@@ -82,8 +84,8 @@ do-init() {
8284
echo_bpm_variables_posix
8385
cat <<-EOF
8486
# bpm completions
85-
if [ -f "\$BPM_ROOT/source/completions/bpm.bash" ]; then
86-
. "\$BPM_ROOT/source/completions/bpm.bash"
87+
if [ -f "\$BPM_REPO_ROOT/completions/bpm.bash" ]; then
88+
. "\$BPM_REPO_ROOT/completions/bpm.bash"
8789
fi
8890
8991
EOF
@@ -105,7 +107,7 @@ do-init() {
105107
echo_bpm_variables_posix
106108
cat <<-EOF
107109
# bpm completions
108-
fpath=("\$BPM_ROOT/source/completions" \$fpath)
110+
fpath=("\$BPM_REPO_ROOT/completions" \$fpath)
109111
EOF
110112

111113
echo_bpm_include_posix

tests/mode-global.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ load 'util/init.sh'
4747
run bpm init bash
4848
assert_success
4949
assert_line -p "export PATH"
50-
assert_line -p '. "$BPM_ROOT/'
50+
assert_line -p '. "$BPM_REPO_ROOT/'
5151
}

0 commit comments

Comments
 (0)