File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -366,14 +366,16 @@ function parse_package_args(args::Vector{PackageToken}; add_or_dev = false)::Vec
366366 parsed_rev = false
367367 while ! isempty (args)
368368 modifier = popfirst! (args)
369- if modifier isa Subdir
369+ if modifier isa PackageIdentifier
370+ pushfirst! (args, modifier)
371+ return
372+ elseif modifier isa Subdir
370373 if parsed_subdir
371374 pkgerror (" Multiple subdir specifiers `$args ` found." )
372375 end
373376 pkg. subdir = modifier. dir
374- (isempty (args) || args[1 ] isa PackageIdentifier) && return
375- modifier = popfirst! (args)
376377 parsed_subdir = true
378+ (isempty (args) || args[1 ] isa PackageIdentifier) && return
377379 elseif modifier isa VersionToken
378380 if parsed_version
379381 pkgerror (" Multiple version specifiers `$args ` found." )
Original file line number Diff line number Diff line change @@ -1184,6 +1184,14 @@ end
11841184 @test api == Pkg. add
11851185 @test args == [Pkg. PackageSpec (; name = " Example" , version = " 0.5.0" )]
11861186 @test isempty (opts)
1187+ # Add multiple packages with version specifier
1188+ api, args, opts
= first (Pkg
. pkg " add [email protected] Test" )
1189+ @test api == Pkg. add
1190+ @test length (args) == 2
1191+ @test args[1 ]. name == " Example"
1192+ @test args[1 ]. version == " 0.5.5"
1193+ @test args[2 ]. name == " Test"
1194+ @test isempty (opts)
11871195 # Add as a weakdep.
11881196 api, args, opts = first (Pkg. pkg " add --weak Example" )
11891197 @test api == Pkg. add
You can’t perform that action at this time.
0 commit comments