norgbackup/norg/utils/run.nim

24 lines
412 B
Nim
Raw Normal View History

import strformat
import osproc
import ../model/maintenance_type
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