File tree 2 files changed +7
-0
lines changed 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ function installed(pkg::AbstractString)
127
127
end
128
128
129
129
function status (io:: IO ; pkgname:: AbstractString = " " )
130
+ if ! isempty (pkgname) && ! ispath (pkgname)
131
+ throw (PkgError (" Package $pkgname does not exist" ))
132
+ end
130
133
showpkg (pkg) = isempty (pkgname) ? true : (pkg == pkgname)
131
134
reqs = Reqs. parse (" REQUIRE" )
132
135
instd = Read. installed ()
158
161
status (io:: IO , pkg:: AbstractString ) = status (io, pkgname = pkg)
159
162
160
163
function status (io:: IO , pkg:: AbstractString , ver:: VersionNumber , fix:: Bool )
164
+ if ! isempty (pkg) && ! ispath (pkg)
165
+ throw (PkgError (" Package $pkg does not exist" ))
166
+ end
161
167
@printf io " - %-29s " pkg
162
168
fix || return println (io,ver)
163
169
@printf io " %-19s" ver
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ temp_pkg_dir() do
63
63
end
64
64
65
65
@test_throws PkgError Pkg. installed (" MyFakePackage" )
66
+ @test_throws PkgError Pkg. status (" MyFakePackage" )
66
67
@test Pkg. installed (" Example" ) === nothing
67
68
68
69
# Check that setprotocol! works.
You can’t perform that action at this time.
0 commit comments