21 lines
378 B
Nim
21 lines
378 B
Nim
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
|
|
|