Skip a few prompts in interactive mode when not using Git

This commit is contained in:
Chris de Graaf 2018-11-05 14:05:57 -06:00
parent 8dfe929cce
commit cd049dbd4c
2 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@ function generate(
if git
# Initialize the repo.
repo = LibGit2.init(pkg_dir)
@info "Initialized git repo at $pkg_dir"
@info "Initialized Git repo at $pkg_dir"
if gitconfig !== nothing
# Configure the repo.
@ -105,7 +105,7 @@ function generate_interactive(
git::Bool=true,
gitconfig::Union{GitConfig, Nothing}=nothing,
)
t = interactive_template(; fast=fast)
t = interactive_template(; git=git, fast=fast)
generate(pkg, t; git=git, gitconfig=gitconfig)
return t
end

View File

@ -126,7 +126,7 @@ end
Interactively create a [`Template`](@ref). If `fast` is set, defaults will be assumed for
all values except username and plugins.
"""
function interactive_template(; fast::Bool=false)
function interactive_template(; git::Bool=true, fast::Bool=false)
@info "Default values are shown in [brackets]"
# Getting the leaf types in a separate thread eliminates an awkward wait after
# "Select plugins" is printed.
@ -144,8 +144,8 @@ function interactive_template(; fast::Bool=false)
throw(ArgumentError("Username is required"))
end
kwargs[:host] = if fast
"https://github.com"
kwargs[:host] = if fast || !git
"https://github.com" # If Git isn't enabled, this value never gets used.
else
default_host = "github.com"
print("Code hosting service [$default_host]: ")
@ -196,7 +196,7 @@ function interactive_template(; fast::Bool=false)
isempty(julia_version) ? default_julia_version : VersionNumber(julia_version)
end
kwargs[:ssh] = if fast
kwargs[:ssh] = if fast || !git
false
else
print("Set remote to SSH? [no]: ")