Fix file move duplicate incrementing and same folder move bugs, fix tooltip wrap and add hover delay
All checks were successful
Automated Container Build / build-and-push (push) Successful in 59s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 59s
This commit is contained in:
parent
e1f009f273
commit
ffea6afeb0
2 changed files with 9 additions and 0 deletions
|
|
@ -4,8 +4,11 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var numberSuffixRegex = regexp.MustCompile(` \(\d+\)$`)
|
||||
|
||||
// GetUniquePath checks if a file or folder exists at the given baseDir with the given name.
|
||||
// If it does, it systematically appends " (1)", " (2)", etc., until it finds an available name.
|
||||
// It returns the unique filename.
|
||||
|
|
@ -18,6 +21,8 @@ func GetUniquePath(baseDir, name string) string {
|
|||
return name
|
||||
}
|
||||
|
||||
base = numberSuffixRegex.ReplaceAllString(base, "")
|
||||
|
||||
for i := 1; ; i++ {
|
||||
newName := fmt.Sprintf("%s (%d)%s", base, i, ext)
|
||||
finalPath = filepath.Join(baseDir, newName)
|
||||
|
|
|
|||
Reference in a new issue