Skip to content

Commit

Permalink
use tempdir instead of tempname in test/pkg.jl
Browse files Browse the repository at this point in the history
since tempname creates a file on windows, but the goal here is creating
a directory. also don't try to delete nonexistent files during cleanup
  • Loading branch information
tkelman committed Nov 22, 2014
1 parent 83f8018 commit dd6cd5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/pkg/dir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function init(meta::String=DEFAULT_META, branch::String=META_BRANCH)
run(`touch REQUIRE`)
end
catch e
rm(dir, recursive=true)
ispath(dir) && rm(dir, recursive=true)
rethrow(e)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/pkg.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function temp_pkg_dir(fn::Function)
# Used in tests below to setup and teardown a sandboxed package directory
const tmpdir = ENV["JULIA_PKGDIR"] = tempname()
const tmpdir = ENV["JULIA_PKGDIR"] = joinpath(tempdir(),randstring())
@test !isdir(Pkg.dir())
try
Pkg.init()
Expand Down

0 comments on commit dd6cd5a

Please sign in to comment.