2024-08-23 09:50:53 +01:00
|
|
|
import strformat
|
|
|
|
import osproc
|
2024-08-27 21:39:21 +01:00
|
|
|
import ../model/log_type
|
2024-08-23 09:50:53 +01:00
|
|
|
|
|
|
|
proc run*(cmd: string): int =
|
2024-08-27 21:16:31 +01:00
|
|
|
debug fmt"Trying to run : {cmd}"
|
2024-08-23 09:50:53 +01:00
|
|
|
try:
|
|
|
|
let res = execCmd(cmd)
|
2024-11-25 11:15:15 +00:00
|
|
|
debug("Run Command Exist Code: " & $res)
|
2024-08-23 09:50:53 +01:00
|
|
|
return res
|
|
|
|
except:
|
2024-08-27 21:16:31 +01:00
|
|
|
error getCurrentExceptionMsg()
|
2024-08-23 09:50:53 +01:00
|
|
|
return 1
|
|
|
|
|
|
|
|
proc runDiscard*(cmd: string): int =
|
2024-08-27 21:16:31 +01:00
|
|
|
debug fmt"Trying to run : {cmd}"
|
2024-08-23 09:50:53 +01:00
|
|
|
try:
|
|
|
|
let res = execCmd(cmd)
|
2024-11-25 11:15:15 +00:00
|
|
|
debug("Run Command Exist Code: " & $res)
|
2024-08-23 09:50:53 +01:00
|
|
|
return res
|
|
|
|
except:
|
2024-08-27 21:16:31 +01:00
|
|
|
error getCurrentExceptionMsg()
|
2024-08-23 09:50:53 +01:00
|
|
|
return 1
|
2024-08-23 14:08:14 +01:00
|
|
|
|