Make sure users can determine which local shell is used when executing commands.
Was: _Only Bash as shell?_
I've only had a quick peek at the code, but I think the bash shell is hardcoded in the runner. Would be nice to let the user define the the shell in tasks.py, since some shells don't share the same syntax.
That's totally on the roadmap, yea. I'll mutate this issue's title/desc to reflect that it's an intended line item, so to speak :) Thanks!
N.B. this is only hardcoded in one spot, invoke/runner.py; it shows up in our vendorized pexpect but all of those bash mentions are in docstrings, so not a problem.
Yes, that was the place I saw it. The best place to make this editable would be the tasks.py in my opinion. What do you think? Just like make does it:
SHELL := /bin/bash
I've been working up to actual config, my general idea is like so:
run kwarg, like echo and friends, so it can be overridden per-execute in any use case.Context object which acts as a config holder & allows one to pass configs around.inv --shell=/bin/zsh mytask. These require use of contextualized tasks to take effect - again see echo.Adding a CLI flag is easy, just follow #32 / #27 re: --echo; having a useful task-module-level way of merging stuff might need more thinking.
Ran into an internal need for this in #152 (see final comment), so, poking now.
The tl;dr of current state of this issue:
run sets its own shell, which is /bin/bash, so that's easily updatedrun uses subprocess' own hardcoded default, /bin/sh, but that should be overrideable via the executable kwargAll done. Simply configure run.shell via any config method, or say run('command', shell='/bin/fish') or whatnot at runtime.
Great, thank you @bitprophet!
(Didn't you want to add it to the 0.12.3 milestone?)
Just for your info, the implementation of this feature breaks Invoke on Windows: #345.