mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-31 06:16:35 -04:00
Fix "shear" throwing errors if no device ID is present (instead of running in offline mode)
This commit is contained in:
+6
-3
@@ -389,8 +389,11 @@ func deletionSync(deletions []string) {
|
|||||||
func ShearRemoteFromClient(targetLocationIncomplete string) {
|
func ShearRemoteFromClient(targetLocationIncomplete string) {
|
||||||
deviceID := ShearLocal(targetLocationIncomplete, "") // remove the target from the local system and get the device ID of the client
|
deviceID := ShearLocal(targetLocationIncomplete, "") // remove the target from the local system and get the device ID of the client
|
||||||
|
|
||||||
// call the server to remotely shear the target and add it to the deletions list
|
if deviceID != "" { // ensure a device ID exists (online mode)
|
||||||
GetSSHOutput("libmuttonserver shear", deviceID+"\n"+strings.ReplaceAll(targetLocationIncomplete, backend.PathSeparator, "\x1d"), false)
|
// call the server to remotely shear the target and add it to the deletions list
|
||||||
|
GetSSHOutput("libmuttonserver shear", deviceID+"\n"+
|
||||||
|
strings.ReplaceAll(targetLocationIncomplete, backend.PathSeparator, "\x1d"), false)
|
||||||
|
}
|
||||||
|
|
||||||
backend.Exit(0) // sync is not required after shearing since the target has already been removed from the local system
|
backend.Exit(0) // sync is not required after shearing since the target has already been removed from the local system
|
||||||
}
|
}
|
||||||
@@ -408,7 +411,7 @@ func RenameRemoteFromClient(oldLocationIncomplete, newLocationIncomplete string)
|
|||||||
strings.ReplaceAll(oldLocationIncomplete, backend.PathSeparator, "\x1d")+"\n"+
|
strings.ReplaceAll(oldLocationIncomplete, backend.PathSeparator, "\x1d")+"\n"+
|
||||||
strings.ReplaceAll(newLocationIncomplete, backend.PathSeparator, "\x1d"), false)
|
strings.ReplaceAll(newLocationIncomplete, backend.PathSeparator, "\x1d"), false)
|
||||||
}
|
}
|
||||||
|
|
||||||
backend.Exit(0)
|
backend.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user