From c70eb550fe57bbe2d757835b07c03bc404121cd1 Mon Sep 17 00:00:00 2001 From: Stephan Hradek Date: Fri, 10 Jun 2022 06:13:32 +0200 Subject: [PATCH] Do not require password and url when compileonly (#193) --- auth.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/auth.go b/auth.go index 816f277..8731ab4 100644 --- a/auth.go +++ b/auth.go @@ -36,10 +36,13 @@ func GetCredentials( if password == "" { password = config.Password if password == "" { - return nil, errors.New( - "Confluence password should be specified using -p " + - "flag or be stored in configuration file", - ) + if ! flags.CompileOnly { + return nil, errors.New( + "Confluence password should be specified using -p " + + "flag or be stored in configuration file", + ) + } + password = "none" } } @@ -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(