Bugfix: No Subdirectory
This commit is contained in:
1 parent
a57f82a546
commit
57dcea32ff
3 files changed
+10
-1
No files matched your search
@@ -1,9 +1,12 @@
|
||||
package main
|
||||
|
||||
func correctPath(path string) string {
|
||||
|
||||
if path[len(path)-1:] == `/` || path[len(path)-1:] == `\` {
|
||||
// Case: E.g. remote dir = /myfiles/
|
||||
return path[:len(path)-1]
|
||||
} else {
|
||||
// Case: E.g. remote dir = /myfiles
|
||||
return path
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
func main() {
|
||||
|
||||
// Show the current version:
|
||||
log.Println(`Sync v1.3.1`)
|
||||
log.Println(`Sync v1.3.2`)
|
||||
|
||||
// Allow Go to use all CPUs:
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
||||
@@ -7,6 +7,12 @@ import (
|
||||
|
||||
func normalisePath(base, path string) string {
|
||||
result := strings.Replace(path, base, ``, 1)
|
||||
|
||||
// Ensure that the path starts with a slash:
|
||||
if len(result) > 1 && result[0:1] != `/` {
|
||||
result = filepath.Join(`/`, result)
|
||||
}
|
||||
|
||||
result = filepath.ToSlash(result)
|
||||
return strings.ToLower(result)
|
||||
}
|
||||
Reference in new issue
Block a user