Fixed ospaths compilation on js (#6826)

This commit is contained in:
Yuriy Glukhov 2017-11-27 16:52:49 -08:00 • committed by Andreas Rumpf
commit c47ed6c537

View file

@ -602,14 +602,13 @@ proc quoteShellPosix*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".}
else: else:
return "'" & s.replace("'", "'\"'\"'") & "'" return "'" & s.replace("'", "'\"'\"'") & "'"
proc quoteShell*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} = when defined(windows) or defined(posix):
## Quote ``s``, so it can be safely passed to shell. proc quoteShell*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} =
when defined(Windows): ## Quote ``s``, so it can be safely passed to shell.
return quoteShellWindows(s) when defined(windows):
elif defined(posix): return quoteShellWindows(s)
return quoteShellPosix(s) else:
else: return quoteShellPosix(s)
{.error:"quoteShell is not supported on your system".}
when isMainModule: when isMainModule:
assert quoteShellWindows("aaa") == "aaa" assert quoteShellWindows("aaa") == "aaa"