mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-31 22:36:38 -04:00
Split sync.Rename into separate functions for client and server to avoid compiling SSH into the server binary
This commit is contained in:
+1
-1
@@ -45,7 +45,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 "\x1d" representing path separators - always pass in UNIX format
|
// stdin[1] is expected to be the OLD incomplete target location with "\x1d" representing path separators - always pass in UNIX format
|
||||||
// stdin[2] is expected to be the NEW incomplete target location with "\x1d" representing path separators - always pass in UNIX format
|
// stdin[2] is expected to be the NEW incomplete target location with "\x1d" representing path separators - always pass in UNIX format
|
||||||
sync.Rename(strings.ReplaceAll(stdin[1], "\x1d", "/"), strings.ReplaceAll(stdin[2], "\x1d", "/"), true)
|
sync.RenameLocal(strings.ReplaceAll(stdin[1], "\x1d", "/"), strings.ReplaceAll(stdin[2], "\x1d", "/"))
|
||||||
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
|
||||||
|
|||||||
+3
-3
@@ -11,13 +11,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RenameCli renames an entry at oldLocation to a new location (user input) on both the client and the server
|
// RenameCli renames an entry at oldLocationIncomplete to a new location (user input) on both the client and the server
|
||||||
func RenameCli(oldLocationIncomplete string) {
|
func RenameCli(oldLocationIncomplete string) {
|
||||||
// prompt user for new location and rename
|
// prompt user for new location and rename
|
||||||
newLocationIncomplete := input("New location:")
|
newLocationIncomplete := input("New location:")
|
||||||
sync.Rename(oldLocationIncomplete, newLocationIncomplete, false)
|
sync.RenameRemoteFromClient(oldLocationIncomplete, newLocationIncomplete)
|
||||||
|
|
||||||
// exit is done from sync.Rename
|
// exit is done from sync.RenameRemoteFromClient
|
||||||
}
|
}
|
||||||
|
|
||||||
// EditEntryField edits a field of an entry at targetLocation (user input)
|
// EditEntryField edits a field of an entry at targetLocation (user input)
|
||||||
|
|||||||
Reference in New Issue
Block a user