feature: added ReplaceAllRestrictedCharactersNoSlashes method
parent
0b2540924b
commit
dd34bd7595
|
@ -61,6 +61,17 @@ func ReplaceAllRestrictedCharacters(filePath string) string {
|
|||
return filePath
|
||||
}
|
||||
|
||||
func ReplaceAllRestrictedCharactersNoSlashes(filePath string) string {
|
||||
for k, v := range RestrictedFilepathCharactersReplacements {
|
||||
if k == "\\" || k == "/" {
|
||||
continue
|
||||
}
|
||||
filePath = strings.ReplaceAll(filePath, k, v)
|
||||
}
|
||||
|
||||
return filePath
|
||||
}
|
||||
|
||||
func TryAbs(filePath string) string {
|
||||
if !filepath.IsAbs(filePath) {
|
||||
abs, err := filepath.Abs(filePath)
|
||||
|
|
Loading…
Reference in New Issue