diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-11 22:35:27 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-11 22:35:27 +0200 |
commit | f976ef5c5d44c7af221fc4df08830f25ff545610 (patch) | |
tree | d0315eda2479cf7e557d29260389243e4cfef977 /skate/cmd | |
parent | 647300ccf3338143291c8ff3ae63a138aa1e56e1 (diff) | |
download | refcat-f976ef5c5d44c7af221fc4df08830f25ff545610.tar.gz refcat-f976ef5c5d44c7af221fc4df08830f25ff545610.zip |
skate-cleanup: append newline
Diffstat (limited to 'skate/cmd')
-rw-r--r-- | skate/cmd/skate-cleanup/main.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/skate/cmd/skate-cleanup/main.go b/skate/cmd/skate-cleanup/main.go index e1c7f3c..e81d4ee 100644 --- a/skate/cmd/skate-cleanup/main.go +++ b/skate/cmd/skate-cleanup/main.go @@ -68,6 +68,9 @@ func urlFilter(p []byte) ([]byte, error) { if url == "" && *skipNonMatches { return nil, nil } + if len(parts) == 1 || *index == len(parts) { + url = url + "\n" + } parts[*index-1] = url return []byte(strings.Join(parts, *delimiter)), nil } |