diff --git a/src/COPIERTemplate.jl b/src/COPIERTemplate.jl index 8f2ad29d..05b244ad 100644 --- a/src/COPIERTemplate.jl +++ b/src/COPIERTemplate.jl @@ -21,7 +21,7 @@ function generate(path, generate_missing_uuid = true; kwargs...) if generate_missing_uuid && !("PackageUUID" in keys(data)) data["PackageUUID"] = string(uuid4()) end - copier.run_copy("https://github.com/abelsiqueira/COPIERTemplate.jl", path; kwargs..., data = data) + copier.run_copy(joinpath(@__DIR__, ".."), path; kwargs..., data = data, vcs_ref = "HEAD") end end diff --git a/test/runtests.jl b/test/runtests.jl index 90347525..f704c81e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -24,16 +24,19 @@ template_options = Dict( COPIERTemplate.generate(tmpdir1; data = template_options, vcs_ref = "main") bash_args = vcat([["-d"; "$k=$v"] for (k, v) in template_options]...) - run( - `copier copy --vcs-ref main $bash_args https://github.com/abelsiqueira/COPIERTemplate.jl $tmpdir2`, - ) + ignore(line) = startswith("_commit")(line) || startswith("_src_path")(line) + template_path = joinpath(@__DIR__, "..") + run(`copier copy --vcs-ref HEAD $bash_args $template_path $tmpdir2`) for (root, dirs, files) in walkdir(tmpdir1) for file in files file1 = joinpath(root, file) file2 = replace(file1, tmpdir1 => tmpdir2) lines1 = readlines(file1) lines2 = readlines(file2) - diff = ["$line1 vs $line2" for (line1, line2) in zip(lines1, lines2) if line1 != line2] + diff = [ + "$line1 vs $line2" for + (line1, line2) in zip(lines1, lines2) if !ignore(line1) && line1 != line2 + ] @test diff == [] end end