User github.user config key instead of github.username
This commit is contained in:
parent
c76acdc81f
commit
82638e31bc
@ -6,7 +6,7 @@ create a template, you can use [`interactive_template`](@ref) instead.
|
||||
|
||||
# Keyword Arguments
|
||||
* `user::AbstractString="")`: GitHub username. If left unset, it will try to take the
|
||||
value of a supplied git config's "github.username" key, then the global git config's
|
||||
value of a supplied git config's "github.user" key, then the global git config's
|
||||
value. If neither is set, an `ArgumentError` is thrown.
|
||||
**This is case-sensitive for some plugins, so take care to enter it correctly.**
|
||||
* `host::AbstractString="github.com"`: URL to the code hosting service where your package
|
||||
@ -70,8 +70,8 @@ don't belong.
|
||||
# and then in the global git config.
|
||||
if isempty(user)
|
||||
user = get(
|
||||
git_config, "github.username",
|
||||
LibGit2.getconfig("github.username", ""),
|
||||
git_config, "github.user",
|
||||
LibGit2.getconfig("github.user", ""),
|
||||
)
|
||||
end
|
||||
if isempty(user)
|
||||
@ -132,7 +132,7 @@ function interactive_template(; fast::Bool=false)
|
||||
plugin_types = @spawn leaves(Plugin)
|
||||
kwargs = Dict{Symbol, Any}()
|
||||
|
||||
default_user = LibGit2.getconfig("github.username", "")
|
||||
default_user = LibGit2.getconfig("github.user", "")
|
||||
print("Enter your username [$(isempty(default_user) ? "REQUIRED" : default_user)]: ")
|
||||
user = readline()
|
||||
kwargs[:user] = if !isempty(user)
|
||||
|
@ -13,7 +13,7 @@ const me = "christopher-dG"
|
||||
const git_config = Dict(
|
||||
"user.name" => "Tester McTestFace",
|
||||
"user.email" => "email@web.site",
|
||||
"github.username" => "TesterMcTestFace",
|
||||
"github.user" => "TesterMcTestFace",
|
||||
)
|
||||
const test_pkg = "TestPkg"
|
||||
const fake_path = bin(hash("/this/file/does/not/exist"))
|
||||
@ -94,7 +94,7 @@ write(test_file, template_text)
|
||||
|
||||
t = Template(; git_config=git_config)
|
||||
rm(t.temp_dir; recursive=true)
|
||||
@test t.user == git_config["github.username"]
|
||||
@test t.user == git_config["github.user"]
|
||||
@test t.authors == git_config["user.name"]
|
||||
|
||||
t = Template(;
|
||||
@ -115,11 +115,11 @@ write(test_file, template_text)
|
||||
)
|
||||
rm(t.temp_dir; recursive=true)
|
||||
|
||||
if isempty(LibGit2.getconfig("github.username", ""))
|
||||
if isempty(LibGit2.getconfig("github.user", ""))
|
||||
@test_throws ArgumentError t = Template()
|
||||
else
|
||||
t = Template()
|
||||
@test t.user == LibGit2.getconfig("github.username", "")
|
||||
@test t.user == LibGit2.getconfig("github.user", "")
|
||||
end
|
||||
rm(t.temp_dir; force=true, recursive=true)
|
||||
@test_throws ArgumentError t = Template(; user=me, license="FakeLicense")
|
||||
@ -208,7 +208,7 @@ end
|
||||
end
|
||||
|
||||
@testset "Badge generation" begin
|
||||
user = git_config["github.username"]
|
||||
user = git_config["github.user"]
|
||||
|
||||
badge = Badge("A", "B", "C")
|
||||
@test badge.hover == "A"
|
||||
|
Loading…
Reference in New Issue
Block a user