diff --git a/src/interactive.jl b/src/interactive.jl index a7d513f9..9b343567 100644 --- a/src/interactive.jl +++ b/src/interactive.jl @@ -13,7 +13,11 @@ function Base.show(io::IO, ::MIME"text/plain", p::T) where T <: Plugin end show_field(x) = repr(x) -show_field(x::AbstractString) = repr(contractuser(x)) +if Sys.iswindows() + show_field(x::AbstractString) = replace(repr(contractuser(x)), "\\\\" => "\\") +else + show_field(x::AbstractString) = repr(contractuser(x)) +end function Base.show(io::IO, m::MIME"text/plain", t::Template) println(io, "Template:") diff --git a/src/template.jl b/src/template.jl index da175bf2..7350a991 100644 --- a/src/template.jl +++ b/src/template.jl @@ -90,7 +90,7 @@ function Template(::Val{false}; kwargs...) plugins = Dict(typeof(p) => p for p in enabled) # TODO: It might be nice to offer some kind of warn_incompatible function - # to be optionally implented by plugins instead of hardcoding this case here. + # to be optionally implemented by plugins instead of hardcoding this case here. julia = getkw(kwargs, :julia_version) julia < v"1.2" && haskey(plugins, Tests) && plugins[Tests].project && @warn string( "The Tests plugin is set to create a project (supported in Julia 1.2 and later)", diff --git a/test/show.jl b/test/show.jl index b48fe7ff..b97c3afe 100644 --- a/test/show.jl +++ b/test/show.jl @@ -5,7 +5,7 @@ const LICENSE_DIR = contractuser(PT.LICENSE_DIR) @testset "Plugins" begin expected = """ Readme: - file: "$DEFAULTS_DIR/README.md" + file: "$(joinpath(DEFAULTS_DIR, "README.md"))" destination: "README.md" inline_badges: false """ @@ -29,14 +29,14 @@ const LICENSE_DIR = contractuser(PT.LICENSE_DIR) ds_store: true dev: true License: - path: "$LICENSE_DIR/MIT" + path: "$(joinpath(LICENSE_DIR, "MIT"))" destination: "LICENSE" Readme: - file: "$DEFAULTS_DIR/README.md" + file: "$(joinpath(DEFAULTS_DIR, "README.md"))" destination: "README.md" inline_badges: false Tests: - file: "$DEFAULTS_DIR/runtests.jl" + file: "$(joinpath(DEFAULTS_DIR, "runtests.jl"))" project: false """ @test sprint(show, MIME("text/plain"), tpl(; authors=USER)) == rstrip(expected)