mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 16:47:20 -04:00
Fix rename prompting for new location before verifying old one exists
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ func main() {
|
|||||||
// stdin[0] is evaluated after fallthrough
|
// stdin[0] is evaluated after fallthrough
|
||||||
// stdin[1] is expected to be the OLD incomplete target location with FSPath representing path separators - always pass in UNIX format
|
// stdin[1] is expected to be the OLD incomplete target location with FSPath representing path separators - always pass in UNIX format
|
||||||
// stdin[2] is expected to be the NEW incomplete target location with FSPath representing path separators - always pass in UNIX format
|
// stdin[2] is expected to be the NEW incomplete target location with FSPath representing path separators - always pass in UNIX format
|
||||||
sync.RenameLocal(strings.ReplaceAll(stdin[1], sync.FSPath, "/"), strings.ReplaceAll(stdin[2], sync.FSPath, "/"))
|
sync.RenameLocal(strings.ReplaceAll(stdin[1], sync.FSPath, "/"), strings.ReplaceAll(stdin[2], sync.FSPath, "/"), true)
|
||||||
fallthrough // fallthrough to add the old entry to the deletions directory
|
fallthrough // fallthrough to add the old entry to the deletions directory
|
||||||
case "shear":
|
case "shear":
|
||||||
// shear an entry from the server and add it to the deletions directory
|
// shear an entry from the server and add it to the deletions directory
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ func main() {
|
|||||||
case "note", "-n":
|
case "note", "-n":
|
||||||
field = 4
|
field = 4
|
||||||
case "rename", "-r":
|
case "rename", "-r":
|
||||||
|
backend.TargetIsFile(targetLocation, true, 0) // ensure location exists before prompting for new location
|
||||||
cli.RenameCli(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
|
cli.RenameCli(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
|
||||||
default:
|
default:
|
||||||
cli.HelpEdit()
|
cli.HelpEdit()
|
||||||
|
|||||||
Reference in New Issue
Block a user