diff --git a/src/template.jl b/src/template.jl index ccf016e..d982d6b 100644 --- a/src/template.jl +++ b/src/template.jl @@ -155,7 +155,10 @@ function interactive_template(; fast::Bool=false) licenses[abs(request(menu))].first end - kwargs[:authors] = if fast + # We don't need to ask for authors or copyright years if there is no license, + # because the license is the only place that they matter. + + kwargs[:authors] = if fast || isempty(kwargs[:license]) LibGit2.getconfig("user.name", "") else default_authors = LibGit2.getconfig("user.name", "") @@ -165,7 +168,7 @@ function interactive_template(; fast::Bool=false) isempty(authors) ? default_authors : authors end - kwargs[:years] = if fast + kwargs[:years] = if fast || isempty(kwargs[:license]) Dates.year(Dates.today()) else default_years = Dates.year(Dates.today()) diff --git a/test/interactive.jl b/test/interactive.jl index 145eb48..f910f52 100644 --- a/test/interactive.jl +++ b/test/interactive.jl @@ -1,9 +1,10 @@ # TerminalMenus.jl has issues in environments without a TTY, # which seems to be the case in Travis CI OSX builds. # https://travis-ci.org/invenia/PkgTemplates.jl/jobs/267682403#L115 +# https://github.com/nick-paul/TerminalMenus.jl/issues/5 @testset "Interactive template creation" begin - write(STDIN.buffer, "$me\n\n\r\n\n\n\n\n\nd") + write(STDIN.buffer, "$me\n\n\r\n\n\n\nd") t = interactive_template() @test t.user == me @test t.host == "github.com"