Skip a few prompts in interactive mode when not using Git
This commit is contained in:
parent
8dfe929cce
commit
cd049dbd4c
@ -21,7 +21,7 @@ function generate(
|
|||||||
if git
|
if git
|
||||||
# Initialize the repo.
|
# Initialize the repo.
|
||||||
repo = LibGit2.init(pkg_dir)
|
repo = LibGit2.init(pkg_dir)
|
||||||
@info "Initialized git repo at $pkg_dir"
|
@info "Initialized Git repo at $pkg_dir"
|
||||||
|
|
||||||
if gitconfig !== nothing
|
if gitconfig !== nothing
|
||||||
# Configure the repo.
|
# Configure the repo.
|
||||||
@ -105,7 +105,7 @@ function generate_interactive(
|
|||||||
git::Bool=true,
|
git::Bool=true,
|
||||||
gitconfig::Union{GitConfig, Nothing}=nothing,
|
gitconfig::Union{GitConfig, Nothing}=nothing,
|
||||||
)
|
)
|
||||||
t = interactive_template(; fast=fast)
|
t = interactive_template(; git=git, fast=fast)
|
||||||
generate(pkg, t; git=git, gitconfig=gitconfig)
|
generate(pkg, t; git=git, gitconfig=gitconfig)
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
@ -126,7 +126,7 @@ end
|
|||||||
Interactively create a [`Template`](@ref). If `fast` is set, defaults will be assumed for
|
Interactively create a [`Template`](@ref). If `fast` is set, defaults will be assumed for
|
||||||
all values except username and plugins.
|
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]"
|
@info "Default values are shown in [brackets]"
|
||||||
# Getting the leaf types in a separate thread eliminates an awkward wait after
|
# Getting the leaf types in a separate thread eliminates an awkward wait after
|
||||||
# "Select plugins" is printed.
|
# "Select plugins" is printed.
|
||||||
@ -144,8 +144,8 @@ function interactive_template(; fast::Bool=false)
|
|||||||
throw(ArgumentError("Username is required"))
|
throw(ArgumentError("Username is required"))
|
||||||
end
|
end
|
||||||
|
|
||||||
kwargs[:host] = if fast
|
kwargs[:host] = if fast || !git
|
||||||
"https://github.com"
|
"https://github.com" # If Git isn't enabled, this value never gets used.
|
||||||
else
|
else
|
||||||
default_host = "github.com"
|
default_host = "github.com"
|
||||||
print("Code hosting service [$default_host]: ")
|
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)
|
isempty(julia_version) ? default_julia_version : VersionNumber(julia_version)
|
||||||
end
|
end
|
||||||
|
|
||||||
kwargs[:ssh] = if fast
|
kwargs[:ssh] = if fast || !git
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
print("Set remote to SSH? [no]: ")
|
print("Set remote to SSH? [no]: ")
|
||||||
|
Loading…
Reference in New Issue
Block a user