Skip to content

Commit dd24e8a

Browse files
authored
vpm: fix installation of mixed modules (#18545)
1 parent ec35d76 commit dd24e8a

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

cmd/tools/vpm.v

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,31 @@ fn main() {
8888
manifest := vmod.from_file('./v.mod') or { panic(err) }
8989
module_names = manifest.dependencies.clone()
9090
}
91-
mut source := Source.vpm
92-
if module_names.all(it.starts_with('https://')) {
93-
source = Source.git
94-
}
91+
9592
if '--once' in options {
9693
module_names = vpm_once_filter(module_names)
94+
9795
if module_names.len == 0 {
9896
return
9997
}
10098
}
101-
if '--git' in options {
102-
source = Source.git
103-
}
104-
if '--hg' in options {
105-
source = Source.hg
99+
100+
external_module_names := module_names.filter(it.starts_with('https://'))
101+
vpm_module_names := module_names.filter(it !in external_module_names)
102+
103+
if vpm_module_names.len > 0 {
104+
vpm_install(vpm_module_names, Source.vpm)
106105
}
107106

108-
vpm_install(module_names, source)
107+
if external_module_names.len > 0 {
108+
mut external_source := Source.git
109+
110+
if '--hg' in options {
111+
external_source = Source.hg
112+
}
113+
114+
vpm_install(external_module_names, external_source)
115+
}
109116
}
110117
'update' {
111118
vpm_update(module_names)

0 commit comments

Comments
 (0)