Skip to content

Commit

Permalink
More docs, remove /c
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Jun 25, 2020
1 parent 30d90ea commit 6da9705
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
27 changes: 26 additions & 1 deletion README.adoc
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration.rs
Expand Up @@ -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: (),
Expand Down

0 comments on commit 6da9705

Please sign in to comment.