Fix sleep
This commit is contained in:
parent
86aea481ac
commit
4994e56a3f
1 changed files with 12 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import macros, osproc, regex, strformat, strutils, tables
|
import macros, osproc, regex, strformat, strutils, tables
|
||||||
|
|
||||||
import os except findExe
|
import os except findExe, sleep
|
||||||
|
|
||||||
import "."/[compat]
|
import "."/[compat]
|
||||||
|
|
||||||
|
|
@ -9,6 +9,17 @@ proc sanitizePath*(path: string, noQuote = false, sep = $DirSep): string =
|
||||||
if not noQuote:
|
if not noQuote:
|
||||||
result = result.quoteShell
|
result = result.quoteShell
|
||||||
|
|
||||||
|
proc sleep*(milsecs: int) =
|
||||||
|
## Sleep at compile time
|
||||||
|
let
|
||||||
|
cmd =
|
||||||
|
when defined(windows):
|
||||||
|
"cmd /c timeout "
|
||||||
|
else:
|
||||||
|
"sleep "
|
||||||
|
|
||||||
|
(oup, ret) = gorgeEx(cmd & $(milsecs / 1000))
|
||||||
|
|
||||||
proc execAction*(cmd: string, retry = 0, nostderr = false): string =
|
proc execAction*(cmd: string, retry = 0, nostderr = false): string =
|
||||||
## Execute an external command - supported at compile time
|
## Execute an external command - supported at compile time
|
||||||
##
|
##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue