2025-05-23 16:02:16 +02:00
|
|
|
import winim, osproc, strutils, strformat
|
2025-05-19 21:56:34 +02:00
|
|
|
|
|
|
|
|
import ../types
|
2025-05-22 20:03:22 +02:00
|
|
|
|
2025-05-23 16:02:16 +02:00
|
|
|
proc taskShell*(command: seq[string]): tuple[output: TaskResult, status: TaskStatus] =
|
2025-05-22 20:03:22 +02:00
|
|
|
|
2025-05-23 16:02:16 +02:00
|
|
|
echo "Executing command: ", command.join(" ")
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
let (output, status) = execCmdEx(command.join(" "))
|
|
|
|
|
return (output, Completed)
|
|
|
|
|
|
|
|
|
|
except CatchableError as err:
|
|
|
|
|
return (fmt"An error occured: {err.msg}" & "\n", Failed)
|