File tree Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 1
1
_bpm () {
2
- local -ra listPreSubcommandOptions=(--help --version)
2
+ local -ra listPreSubcommandOptions=(--help --version --global )
3
3
local -ra listSubcommands=(add echo init link list package-path remove upgrade)
4
4
5
5
local -r currentWord=" ${COMP_WORDS[COMP_CWORD]} "
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ main() {
15
15
source " $f "
16
16
done
17
17
18
+ local is_global=' no'
19
+
18
20
for arg; do
19
21
case " $arg " in
20
22
--help)
@@ -28,14 +30,37 @@ main() {
28
30
exit
29
31
;;
30
32
--global)
31
- declare -rg BPM_MODE_GLOBAL=
33
+ is_global=' yes'
34
+ shift
32
35
;;
33
36
* )
34
37
break
35
38
;;
36
39
esac
37
40
done
38
41
42
+ if [ " $is_global " = ' no' ]; then
43
+ if ! project_root_directory=" $(
44
+ while [[ ! -f " bpm.toml" && " $PWD " != / ]]; do
45
+ cd ..
46
+ done
47
+
48
+ if [[ $PWD == / ]]; then
49
+ die " No 'bpm.toml' file found. Please create one to install local packages or pass the '--global' option"
50
+ fi
51
+
52
+ printf " %s" " $PWD "
53
+ ) " ; then
54
+ exit 1
55
+ fi
56
+
57
+ BPM_PREFIX=" $project_root_directory /bpm_packages"
58
+ BPM_PACKAGES_PATH=" $BPM_PREFIX /packages"
59
+ BPM_INSTALL_BIN=" $BPM_PREFIX /bin"
60
+ BPM_INSTALL_MAN=" $BPM_PREFIX /man"
61
+ BPM_INSTALL_COMPLETIONS=" $BPM_PREFIX /completions"
62
+ fi
63
+
39
64
case " $1 " in
40
65
add)
41
66
shift
Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ do-plumbing-remove-deps() {
20
20
fi
21
21
fi
22
22
23
- # TODO: bug: this removes dependencies specified with incorrect URLs
24
23
log.info " Removing dependencies for '$package '"
25
24
for dep in " ${deps[@]} " ; do
26
25
util.construct_clone_url " $repoSpec " " $with_ssh "
27
- local uri=" $REPLY1 "
28
26
local site=" $REPY2 "
29
27
local package=" $REPLY3 "
30
28
local ref=" $REPLY4 "
31
29
32
- rm -rf " ${BPM_PACKAGES_PATH:? } /$package "
30
+ rm -rf " ${BPM_PACKAGES_PATH:? } /$site / $ package"
33
31
done
34
32
}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bats
2
+
3
+ # TODO
You can’t perform that action at this time.
0 commit comments