Implemented move and copy command. Needs to be reworked to work without `-f' and '-t' flags but with spaces.

This commit is contained in:
Jakob Friedl
2025-07-09 15:13:37 +02:00
parent bb56ed42f2
commit 2d2c94ed38
5 changed files with 91 additions and 3 deletions

View File

@@ -55,6 +55,14 @@ proc taskRemoveDirectory*(cq: Conquest, arguments: seq[string]) =
let payload = %*{ "directory": arguments.join(" ").replace("\"").replace("'")}
cq.createTask(RemoveDirectory, $payload, "Tasked agent to remove directory.")
proc taskMove*(cq: Conquest, oldPath, newPath: string) =
let payload = %*{ "from": oldPath, "to": newPath}
cq.createTask(Move, $payload, "Tasked agent to move a file or directory.")
proc taskCopy*(cq: Conquest, oldPath, newPath: string) =
let payload = %*{ "from": oldPath, "to": newPath}
cq.createTask(Copy, $payload, "Tasked agent to copy a file or directory.")
proc taskExecuteBof*(cq: Conquest, file: string, arguments: seq[string]) =
# Verify that the object file exists