From 6da970583313c33819a13c510f84408464e9d61c Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Wed, 24 Jun 2020 21:00:47 -0700 Subject: [PATCH] More docs, remove `/c` --- README.adoc | 27 ++++++++++++++++++++++++++- tests/integration.rs | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 6ac377918d..81c5d5746a 100644 --- a/README.adoc +++ b/README.adoc @@ -694,9 +694,34 @@ Yo from a shell script! Hello from ruby! ``` -On Windows, shebang commands containing a `/` are translated from Unix-style +==== Shebang Recipe Execution on Windows + +On Windows, shebang interpreter paths containing a `/` are translated from Unix-style paths to Windows-style paths using `cygpath`, a utility that ships with http://www.cygwin.com[Cygwin]. +For example, to execute this recipe on Windows: + +```make +echo: + #!/usr/bin/env sh + + echo "Hello!" +``` + +The interpreter path `/usr/bin/env` will be translated to a Windows-style path for +executation using `cygpath`. + +If the interpreter path does not contain a `/`, it will be executed without being +translated with `cygpath`. This is useful if `cygpath` is not available, or you +wish to use a Windows style path to the interpreter: + +```make +echo: + #!C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe + + echo "Hello!" +``` + === Multi-line Constructs Recipes without an initial shebang are evaluated and run line-by-line, which means that multi-line constructs probably won't do what you want. diff --git a/tests/integration.rs b/tests/integration.rs index 6ea2b83680..117303ab41 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2641,7 +2641,7 @@ test! { name: windows_shebang_path, justfile: r#" foo: - #!C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe /c + #!C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe echo "Batch file, baby!" "#, args: (),