mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
Fixed double colon issue
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -204,7 +205,8 @@ func (d *Document) DumpFile() string {
|
|||||||
path := filepath.Join(strings.Replace(d.fullName, "~", usr.HomeDir, 1))
|
path := filepath.Join(strings.Replace(d.fullName, "~", usr.HomeDir, 1))
|
||||||
path = strings.Replace(path, `/`, `\`, -1)
|
path = strings.Replace(path, `/`, `\`, -1)
|
||||||
path = strings.TrimPrefix(path, `\`)
|
path = strings.TrimPrefix(path, `\`)
|
||||||
path = strings.Replace(path, `\`, `:\`, 1)
|
reg := regexp.MustCompile(`(^)([a-zA-z])(:?\\)`)
|
||||||
|
path = reg.ReplaceAllString(path, `$2:\`)
|
||||||
return strings.Replace(path, ".psd", ".json", 1)
|
return strings.Replace(path, ".psd", ".json", 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user