Fixed ospaths compilation on js (#6826)
This commit is contained in:
parent
58c3e5d2f5
commit
c47ed6c537
1 changed files with 7 additions and 8 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue