Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
fix for nil metadata (issue kovetskiy#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjaimon2012 authored Feb 23, 2022
1 parent 2f34e93 commit d0e7820
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,23 @@ func processFile(
if err != nil {
log.Fatal(err)
}

if pageID != "" && meta != nil {
log.Warning(
`specified file contains metadata, ` +
`but it will be ignored due specified command line URL`,
)

meta = nil
}

if pageID == "" && meta == nil {
log.Fatal(
`specified file doesn't contain metadata ` +
`and URL is not specified via command line ` +
`or doesn't contain pageId GET-parameter`,
)
}

switch {
case meta.Space == "" && flags.Space == "":
Expand Down Expand Up @@ -261,23 +278,6 @@ func processFile(
os.Exit(0)
}

if pageID != "" && meta != nil {
log.Warning(
`specified file contains metadata, ` +
`but it will be ignored due specified command line URL`,
)

meta = nil
}

if pageID == "" && meta == nil {
log.Fatal(
`specified file doesn't contain metadata ` +
`and URL is not specified via command line ` +
`or doesn't contain pageId GET-parameter`,
)
}

var target *confluence.PageInfo

if meta != nil {
Expand Down

0 comments on commit d0e7820

Please sign in to comment.