pathstring
The path to convert.
from_slash(path: string) --> stringSome Windows programs read a forward slash as the start of an option, so a path written with forward slashes fails when passed to them. Wrap the path in from_slash to pass it with the separator of the operating system:
terraform { before_hook "setup" { commands = ["apply", "plan"] execute = ["cmd", "/c", from_slash("${get_terragrunt_dir()}/scripts/setup.bat")] }}On Windows, cmd runs C:\work\live\app\scripts\setup.bat for a unit in C:\work\live\app.
On Linux and macOS, from_slash returns path unchanged. To go the other way, use to_slash.
The path to convert.
locals { script = from_slash("scripts/setup.bat") # "scripts\setup.bat" on Windows}