Skip to content

Commit

Permalink
Make sure '/, ' or ' ,/' are not in the path
Browse files Browse the repository at this point in the history
  • Loading branch information
amnuts committed Oct 31, 2023
1 parent 11c3ff4 commit 6418acc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion path_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"os"
"path/filepath"
"regexp"
"strings"
"time"
)

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 6418acc

Please sign in to comment.