fix(thumb blob path): separators be wrongly modified

pull/3116/head
Darren Yu 10 months ago
parent 67c6f937c9
commit ab0a6bf30c
No known key found for this signature in database
GPG Key ID: 2D69AA5646405984

@ -164,7 +164,11 @@ func ReplaceMagicVar(rawString string, fsSeparator string, pathAvailable bool, b
return match return match
case "{blob_path}": case "{blob_path}":
if blobAvailable { if blobAvailable {
return filepath.Dir(completeBlobPath) + fsSeparator lastSlash := strings.LastIndexAny(completeBlobPath, "/\\")
if lastSlash >= 0 {
return completeBlobPath[:lastSlash] + fsSeparator
}
return fsSeparator
} }
return match return match
default: default:

Loading…
Cancel
Save