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 11_bpm () {
2- local -ra listPreSubcommandOptions=(--help --version)
2+ local -ra listPreSubcommandOptions=(--help --version --global )
33 local -ra listSubcommands=(add echo init link list package-path remove upgrade)
44
55 local -r currentWord=" ${COMP_WORDS[COMP_CWORD]} "
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ main() {
1515 source " $f "
1616 done
1717
18+ local is_global=' no'
19+
1820 for arg; do
1921 case " $arg " in
2022 --help)
@@ -28,14 +30,37 @@ main() {
2830 exit
2931 ;;
3032 --global)
31- declare -rg BPM_MODE_GLOBAL=
33+ is_global=' yes'
34+ shift
3235 ;;
3336 * )
3437 break
3538 ;;
3639 esac
3740 done
3841
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+
3964 case " $1 " in
4065 add)
4166 shift
Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ do-plumbing-remove-deps() {
2020 fi
2121 fi
2222
23- # TODO: bug: this removes dependencies specified with incorrect URLs
2423 log.info " Removing dependencies for '$package '"
2524 for dep in " ${deps[@]} " ; do
2625 util.construct_clone_url " $repoSpec " " $with_ssh "
27- local uri=" $REPLY1 "
2826 local site=" $REPY2 "
2927 local package=" $REPLY3 "
3028 local ref=" $REPLY4 "
3129
32- rm -rf " ${BPM_PACKAGES_PATH:? } /$package "
30+ rm -rf " ${BPM_PACKAGES_PATH:? } /$site / $ package"
3331 done
3432}
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