-
-
Notifications
You must be signed in to change notification settings - Fork 612
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 to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for working with shell options #908
Comments
Original discussion: https://discord.com/channels/974121106208354339/1035164287695589457 If we were going to support a But I'm not sure it's really needed. I'm more inclined to just enable Anyone disagrees? |
I don't have any objection to this. My only concern is that for anyone using To be clear, I think this is a very uncommon scenario, but worth considering |
Good point about backward compatibility. Maybe we have to have the option then, and delay the default change to the next major version only. |
I am not sure if such are supported by mvdan/sh, but there are various other globbing options, such as
There is a lot of tooling that only operates on files, most being formatters and linters like clang-format or flake8. This is a huge use case for build tools, which Task claims to be. To be a good one, Task needs to be able to work well with such tools, and so has to be able to glob well.
While it will be a breaking change, considering that |
@sernot agreed with everything you said. When I said
I was referring to the number of cases where this would be a breaking change, not the use of |
I've opened another issue to track changing the default value. This issue can remain focussed on a |
Gonna drop my two cents here as well
Or (i like this one more):
So basically, adding an ability to include a shell that will be automatically used in every CLI call, will (possibly) eliminate the requirement of having a shebang on top of a script, bc it will not be required if ran from a shell, and also adds an ability to use features exclusive to a shell This probably requires a separate issue, but idk, maybe related to this one |
While globbing/globstar is an important option it is not only one. If shell options are to be made configurable, please make it in a more general way, allowing to set the equivalent of I stumbled across this issue while trying to find a workaround for #392 |
I would love to see #929 merged. A task like: pass:
cmds:
- set -o pipefail && exit 1 | echo "Hello" as suggested in #392 (comment) did not work for me (platform: Mysteriously, |
@cdfa I agree that it would be nice to get this merged. However, as it stands, the implementation isn't perfect. We'd like to see mvdan/sh#962 merged so that we can tidy it up a bit and I simply haven't had time to look into the upstream code yet. In the meantime, I've tidied up the PR a bit. Hopefully we can get it merged with the "workaround" in place and make some improvements later. |
Problem
The double-star (
**
) glob syntax, meaning a deep recursive directory walk, is commonly used, and is available in Task insources
andgenerates
directives by default.However, like in other shells, the shell in Task requires the
globstar
option to be set for the syntax to work.Because shells are isolated across cmds run by Task, creating a task that uses globstar will require to reset the option in every single command:
This is hard to write and read.
Other useful shell options have to be handled in a similarly verbose way.
Request
Allow to set shell options per-task and apply such to all commands.
To match
generates
andsources
, theglobstar
shell option itself should be enabled by default, while any others are to be controlled by the new Taskfile options.The text was updated successfully, but these errors were encountered: