Skip to content

Shell

Shell command helpers for Wetlands-generated scripts.

Functions:

Name Description
shell_quote

Quote a single shell argument for the script shell used by CommandExecutor.

shell_quote(value)

Quote a single shell argument for the script shell used by CommandExecutor.

Source code in wetlands/_internal/shell.py
def shell_quote(value: Any) -> str:
    """Quote a single shell argument for the script shell used by CommandExecutor."""
    text = str(value)
    if platform.system() == "Windows":
        return "'" + text.replace("'", "''") + "'"
    return shlex.quote(text)