From 6418accfe510b425184f53bbb53ff77016721681 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Tue, 31 Oct 2023 13:27:27 +0000 Subject: [PATCH] Make sure '/, ' or ' ,/' are not in the path --- path_parser.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/path_parser.go b/path_parser.go index da96f7e..36013f3 100644 --- a/path_parser.go +++ b/path_parser.go @@ -15,6 +15,7 @@ import ( "os" "path/filepath" "regexp" + "strings" "time" ) @@ -205,7 +206,8 @@ func ProcessPathSubstitution(placeholderText string, metadata *ImageMetadata) st } placeholderText += "/" + filepath.Base(metadata.FilePath) - placeholderText = NormalizePath(placeholderText) + placeholderText = strings.Replace(NormalizePath(placeholderText), "/, /", "/", -1) + placeholderText = strings.Replace(placeholderText, ", /", "/", -1) return placeholderText }