norgbackup/norg/utils/run.nim

23 lines
403 B
Nim
Raw Normal View History

import strformat
import osproc
2024-08-27 22:16:31 +02:00
import threadlogging
proc run*(cmd: string): int =
2024-08-27 22:16:31 +02:00
debug fmt"Trying to run : {cmd}"
try:
let res = execCmd(cmd)
return res
except:
2024-08-27 22:16:31 +02:00
error getCurrentExceptionMsg()
return 1
proc runDiscard*(cmd: string): int =
2024-08-27 22:16:31 +02:00
debug fmt"Trying to run : {cmd}"
try:
let res = execCmd(cmd)
return res
except:
2024-08-27 22:16:31 +02:00
error getCurrentExceptionMsg()
return 1