Skip authors and years if no license is chosen
This commit is contained in:
parent
063ce773ac
commit
0992baeb87
@ -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())
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user