diff --git a/src/generate.jl b/src/generate.jl index 58c1aac..9f2c1df 100644 --- a/src/generate.jl +++ b/src/generate.jl @@ -145,7 +145,7 @@ function gen_tests(pkg_dir::AbstractString, t::Template) """ gen_file(joinpath(pkg_dir, "test", "runtests.jl"), text) - return ["Manifest.toml", "test/"] + return ["test/"] end """ @@ -227,7 +227,9 @@ function gen_gitignore(pkg_dir::AbstractString, t::Template) text = join(seen, "\n") gen_file(joinpath(pkg_dir, ".gitignore"), text) - return [".gitignore"] + files = [".gitignore"] + t.manifest && push!(files, "Manifest.toml") + return files end """ diff --git a/test/tests.jl b/test/tests.jl index 8058e26..222e2ad 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -205,11 +205,17 @@ end gitignore = read(joinpath(pkg_dir, ".gitignore"), String) rm(joinpath(pkg_dir, ".gitignore")) @test occursin(".DS_Store", gitignore) + @test occursin("Manifest.toml", gitignore) for p in values(t.plugins) for entry in p.gitignore @test occursin(entry, gitignore) end end + t = Template(; user=me, manifest=true) + @test gen_gitignore(pkg_dir, t) == [".gitignore", "Manifest.toml"] + gitignore = read(joinpath(pkg_dir, ".gitignore"), String) + @test !occursin("Manifest.toml", gitignore) + rm(joinpath(pkg_dir, ".gitignore")) # Test the license generation. @test gen_license(pkg_dir, t) == ["LICENSE"] @@ -227,7 +233,7 @@ end rm(joinpath(pkg_dir, "REQUIRE")) # Test the test generation. - @test gen_tests(pkg_dir, t) == ["Manifest.toml", "test/"] + @test gen_tests(pkg_dir, t) == ["test/"] @test isfile(joinpath(pkg_dir, "Project.toml")) project = read(joinpath(pkg_dir, "Project.toml"), String) @test occursin("[extras]\nTest = ", project)