|
|
|
@ -4,6 +4,7 @@ import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"math/rand"
|
|
|
|
"math/rand"
|
|
|
|
|
|
|
|
"path"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
"regexp"
|
|
|
|
"regexp"
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
@ -164,11 +165,7 @@ func ReplaceMagicVar(rawString string, fsSeparator string, pathAvailable bool, b
|
|
|
|
return match
|
|
|
|
return match
|
|
|
|
case "{blob_path}":
|
|
|
|
case "{blob_path}":
|
|
|
|
if blobAvailable {
|
|
|
|
if blobAvailable {
|
|
|
|
lastSlash := strings.LastIndexAny(completeBlobPath, "/\\")
|
|
|
|
return path.Dir(completeBlobPath) + fsSeparator
|
|
|
|
if lastSlash >= 0 {
|
|
|
|
|
|
|
|
return completeBlobPath[:lastSlash] + fsSeparator
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return fsSeparator
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return match
|
|
|
|
return match
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
|