-
Notifications
You must be signed in to change notification settings - Fork 543
Stabilize [script(…)]
attribute
#2260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree 8000 to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is it possible to add ext name support for
And following code is clean.
If you use JavaScript/Types, lots of extension names: js, cjs, mjs, ts, mts.
|
I think that would probably be confusing, and using an additional attribute for the extension isn't much of a burden. But note that an extension is only required if the interpreter requires one. Most don't, in fact the only interpreters I know if that will fail without the correct extension is |
Also, one more reason for not stabilizing the |
I wonder if there's a way to conditionally includes settings or variables to recipt like the SH := "sh"
[cfg_attr(unix, ```
set shell := ["bash", "-c"] // setting
SH := bash // variable
```)]
[cfg_attr(windows, ```
set shell := ["cmd", "/c"]
SH := cmd
```)]
[cfg_attr(cygwin, ```
set shell := ["bash", "-c"] // overwrite windows
SH := cygwin
CYGWIN := 1
```)]
[cfg_attr(true, ```
set unstable
UNSTABLE := 1
```)]
foo:
echo {{SH}} // print "cygwin" or "bash" or "cmd"
echo {{CYGWIN}} // print "1" or ""
echo {{UNSTABLE}} // print "1"
bar:
echo {{SH}} // print "sh"
echo {{CYGWIN}} // print ""
echo {{UNSTABLE}} // print "" |
@g9wp This seems unrelated to the |
This is a more general solution, |
One thing I have come across was that to get syntax highlighting to work in |
@RoloEdits Good catch! I think I would lean heavily towards not allowing both |
It wouldn't fix all the issues with shebangs, but what are your thoughts on adding the functionality of |
I would love to move the functionality of |
I'll discuss more in #1549 as that seems to encompass this more specifically. |
I'm hitting an issue where I can't set a different My use-case is using I want to do this: set script-interpreter := if os() == "windows" {
["busybox", "sh", "-eu"]
} else {
["sh", "-eu"]
} Is there any clever way to hack this? |
@casey There isn't, unfortunately. For the shell, we have the |
A
[script(…)]
attribute was added in #2259. See #1479 for discussion.The attribute is currently unstable.
Before stabilization:
script
the right name?script-interpreter
setting and allow an empty[script]
attribute.The text was updated successfully, but these errors were encountered: