From 54a31a06daaa7005c061fd20acfbed02de65bfac Mon Sep 17 00:00:00 2001 From: Jonas Schulze Date: Thu, 22 Aug 2019 02:34:07 +0200 Subject: [PATCH] Update default manifest file name 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". --- src/Types.jl | 2 +- test/pkg.jl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Types.jl b/src/Types.jl index a19e5f0ffd..800bff4aa3 100644 --- a/src/Types.jl +++ b/src/Types.jl @@ -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) diff --git a/test/pkg.jl b/test/pkg.jl index ca39abfc36..0a74450355 100644 --- a/test/pkg.jl +++ b/test/pkg.jl @@ -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")