Make minor change to interactive prompt style

This commit is contained in:
Chris de Graaf 2017-09-04 19:00:18 +01:00
parent fcf435d7ec
commit bc21eca106
3 changed files with 5 additions and 5 deletions

View File

@ -94,7 +94,7 @@ pattern. They can implement [`gen_plugin`](@ref), [`badges`](@ref), and
"You got lucky with {{PKGNAME}}, {{USER}}!", "You got lucky with {{PKGNAME}}, {{USER}}!",
template, template,
) )
gen_file(joinpath(dir, ".myplugin.yml"), text) gen_file(joinpath(dir, pkg_name, ".myplugin.yml"), text)
else else
println("Maybe next time.") println("Maybe next time.")
end end
@ -246,14 +246,14 @@ function interactive(
# "MyPlugin" to be called "myplugin.yml". # "MyPlugin" to be called "myplugin.yml".
fn = file != nothing && isempty(file) ? "$(lowercase(plugin_name)).yml" : file fn = file != nothing && isempty(file) ? "$(lowercase(plugin_name)).yml" : file
default_config_file = fn == nothing ? fn : joinpath(DEFAULTS_DIR, fn) default_config_file = fn == nothing ? fn : joinpath(DEFAULTS_DIR, fn)
print("Enter the config template filename for $plugin_name (\"None\" for no file) ") print("$plugin_name: Enter the config template filename (\"None\" for no file) ")
if default_config_file == nothing if default_config_file == nothing
print("[None]: ") print("[None]: ")
else else
print("[$(replace(default_config_file, homedir(), "~"))]: ") print("[$(replace(default_config_file, homedir(), "~"))]: ")
end end
config_file = readline() config_file = readline()
config_file = if config_file == "None" config_file = if uppercase(config_file) == "NONE"
nothing nothing
elseif isempty(config_file) elseif isempty(config_file)
default_config_file default_config_file

View File

@ -61,6 +61,6 @@ end
function interactive(plugin_type::Type{<:Documenter}) function interactive(plugin_type::Type{<:Documenter})
plugin_name = split(string(plugin_type), ".")[end] plugin_name = split(string(plugin_type), ".")[end]
print("Enter any Documenter asset files for $plugin_name (separated by spaces) []: ") print("$plugin_name: Enter any Documenter asset files (separated by spaces) []: ")
return plugin_type(; assets=String.(split(readline()))) return plugin_type(; assets=String.(split(readline())))
end end

View File

@ -23,7 +23,7 @@ adds appropriate badges to the README, and updates the `.gitignore` accordingly.
end end
end end
function badges(_::GitHubPages, user::AbstractString, pkg_name::AbstractString) function badges(::GitHubPages, user::AbstractString, pkg_name::AbstractString)
return [ return [
format(Badge( format(Badge(
"Stable", "Stable",