Skip to content

Commit

Permalink
Update default manifest file name
Browse files Browse the repository at this point in the history
If a new project is created using "JuliaProject.toml" instead of
"Project.toml", the corresponding manifest file should be named
"JuliaManifest.toml" instead of "Manifest.toml".
  • Loading branch information
jonas-schulze committed Aug 29, 2019
1 parent 60f47de commit 54a31a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function manifestfile_path(env_path::String; strict=false)
maybe_file = joinpath(env_path, name)
isfile(maybe_file) && return maybe_file
end
return strict ? nothing : joinpath(env_path, "Manifest.toml")
return strict ? nothing : replace(projectfile_path(env_path), r"Project\.toml$" => "Manifest.toml")
end

function find_project_file(env::Union{Nothing,String}=nothing)
Expand Down
17 changes: 17 additions & 0 deletions test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,23 @@ end
end end
end

@testset "create manifest file similar to project file" begin
cd_tempdir() do dir
touch(joinpath(dir, "Project.toml"))
Pkg.activate(".")
Pkg.add("Example")
@test isfile(joinpath(dir, "Manifest.toml"))
@test !isfile(joinpath(dir, "JuliaManifest.toml"))
end
cd_tempdir() do dir
touch(joinpath(dir, "JuliaProject.toml"))
Pkg.activate(".")
Pkg.add("Example")
@test !isfile(joinpath(dir, "Manifest.toml"))
@test isfile(joinpath(dir, "JuliaManifest.toml"))
end
end

include("repl.jl")
include("api.jl")
include("registry.jl")
Expand Down

0 comments on commit 54a31a0

Please sign in to comment.