diff --git a/san.go b/path.go similarity index 94% rename from san.go rename to path.go index 508f24a..f4129d2 100644 --- a/san.go +++ b/path.go @@ -20,7 +20,7 @@ func SanitizeFilename(filename string) string { filename = strings.TrimLeft(filename, " -~") filename = strings.TrimSpace(filename) filename = strings.Replace(filename, " ", "_", -1) - filename = strings.Replace(filename, "_-_", "", -1) + filename = strings.Replace(filename, "_-_", "-", -1) var ( st strings.Builder prev rune diff --git a/cmd/main.go b/santree/main.go similarity index 95% rename from cmd/main.go rename to santree/main.go index f38913e..22eae82 100644 --- a/cmd/main.go +++ b/santree/main.go @@ -28,7 +28,7 @@ func main() { if path != filepath.Join(newpath, filename) { fmt.Println(path, "->", filepath.Join(newpath, filename)) os.MkdirAll(newpath, os.ModePerm) - os.Rename(path, filepath.Join(newpath, info.Name())) + fmt.Println(os.Rename(path, filepath.Join(newpath, filename))) } if !(strings.HasPrefix(path, previousDir) || previousDir == "./") { rmpath := previousDir