File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,17 @@ do-actual-add() {
84
84
die " Cannot install packages owned by username 'local' because that conflicts with linked packages"
85
85
fi
86
86
87
- log.info " Adding '$repoSpec '"
87
+ if [ -e " $BPM_PACKAGES_PATH /$site /$package " ]; then
88
+ if [ " $BPM_IS_LOCAL " = yes ]; then
89
+ log.info " Skipping '$site /$package ' as it's already present"
90
+ return
91
+ else
92
+ die " Package '$site /$package ' is already present"
93
+ fi
94
+ else
95
+ log.info " Adding '$repoSpec '"
96
+ fi
97
+
88
98
do-plumbing-clone " $uri " " $site /$package " " $ref " " $flag_branch "
89
99
do-plumbing-add-deps " $site /$package "
90
100
do-plumbing-link-bins " $site /$package "
Original file line number Diff line number Diff line change @@ -310,3 +310,26 @@ load 'util/init.sh'
310
310
assert_failure
311
311
assert_line -p " Cannot pass '--all' without a 'bpm.toml' file"
312
312
}
313
+
314
+ @test " --all works if some are already installed" {
315
+ local site=' github.com'
316
+ local pkg1=' user/project'
317
+ local pkg2=' user/project2'
318
+
319
+ test_util.create_package " $pkg1 "
320
+ test_util.create_package " $pkg2 "
321
+
322
+ echo " dependencies = [ 'file://$BPM_ORIGIN_DIR /$pkg1 ' ]" > ' bpm.toml'
323
+ BPM_IS_LOCAL=' yes' run do-add --all
324
+
325
+ assert_success
326
+
327
+ echo " dependencies = [ 'file://$BPM_ORIGIN_DIR /$pkg1 ', 'file://$BPM_ORIGIN_DIR /$pkg2 ' ]" > ' bpm.toml'
328
+ BPM_IS_LOCAL=' yes' run do-add --all
329
+
330
+ assert_success
331
+ assert [ -d " ./bpm_packages/packages/$site /$pkg1 " ]
332
+ assert [ -d " ./bpm_packages/packages/$site /$pkg1 /.git" ]
333
+ assert [ -d " ./bpm_packages/packages/$site /$pkg2 " ]
334
+ assert [ -d " ./bpm_packages/packages/$site /$pkg2 /.git" ]
335
+ }
You can’t perform that action at this time.
0 commit comments