norgbackup/norg/utils/run.nim

22 lines
403 B
Nim

import strformat
import osproc
import threadlogging
proc run*(cmd: string): int =
debug fmt"Trying to run : {cmd}"
try:
let res = execCmd(cmd)
return res
except:
error getCurrentExceptionMsg()
return 1
proc runDiscard*(cmd: string): int =
debug fmt"Trying to run : {cmd}"
try:
let res = execCmd(cmd)
return res
except:
error getCurrentExceptionMsg()
return 1