norgbackup/norg/utils/run.nim

22 lines
378 B
Nim
Raw Normal View History

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