mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 18:53:58 +00:00
Fixed ospaths compilation on js (#6826)
This commit is contained in:
committed by
Andreas Rumpf
parent
58c3e5d2f5
commit
c47ed6c537
@@ -602,14 +602,13 @@ proc quoteShellPosix*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".}
|
||||
else:
|
||||
return "'" & s.replace("'", "'\"'\"'") & "'"
|
||||
|
||||
proc quoteShell*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} =
|
||||
## Quote ``s``, so it can be safely passed to shell.
|
||||
when defined(Windows):
|
||||
return quoteShellWindows(s)
|
||||
elif defined(posix):
|
||||
return quoteShellPosix(s)
|
||||
else:
|
||||
{.error:"quoteShell is not supported on your system".}
|
||||
when defined(windows) or defined(posix):
|
||||
proc quoteShell*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} =
|
||||
## Quote ``s``, so it can be safely passed to shell.
|
||||
when defined(windows):
|
||||
return quoteShellWindows(s)
|
||||
else:
|
||||
return quoteShellPosix(s)
|
||||
|
||||
when isMainModule:
|
||||
assert quoteShellWindows("aaa") == "aaa"
|
||||
|
||||
Reference in New Issue
Block a user