Do not require password and url when compileonly (#193)

This commit is contained in:
Stephan Hradek 2022-06-10 06:13:32 +02:00 committed by GitHub
parent abfd01cc74
commit c70eb550fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,11 +36,14 @@ func GetCredentials(
if password == "" {
password = config.Password
if password == "" {
if ! flags.CompileOnly {
return nil, errors.New(
"Confluence password should be specified using -p " +
"flag or be stored in configuration file",
)
}
password = "none"
}
}
if password == "-" {
@ -55,6 +58,10 @@ func GetCredentials(
password = string(stdin)
}
if flags.CompileOnly && targetURL == "" {
targetURL = "http://localhost"
}
url, err := url.Parse(targetURL)
if err != nil {
return nil, karma.Format(