nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.46k stars 59 forks source link

Using bash instead of default shell #27

Closed Algirdyz closed 2 years ago

Algirdyz commented 3 years ago

So right now poe checks the $SHELL variable and uses that shell to run the commands when using shell type.

Why was this the choice? Seems a bit strange. While I do use fish myself, I do not want to write poe tasks on my projects to also use it. I would like everyone to be able to jus run poe commands if they checkout the code without having fish.

make for example ignores $SHELL. And this makes sense because these command should be cross platform and not require a developer setup a specific environment to be able to use the project.

Anyway, this would be a breaking change so maybe configuration is the way to go? I could try make a pull request myself if there is some consensus on what's the best way to handle this.

nat-n commented 3 years ago

Hi @Algirdyz, thanks for the feedback.

I think you're right. The use of $SHELL was an ill conceived attempt to ensure portability, and should probably be removed. Using bash as a lowest common denominator by default probably makes the most sense.

I intend to do so as part of addressing #15. I'm OK with a breaking change for this (we're not 1.0.0 yet), though I'd want to make it smooth which implies mostly addressing #15 by supporting something like a task level option to specify a shell executable (or ordered list thereof to try). Unfortunately I think this a little complicated to get right.

I'm happy to accept help in the form of design feedback and PRs (though I'm likely to be quite picky about what gets merged from a PR).

ThatXliner commented 3 years ago

Have you thought about using shellingham or use a custom POE_SHELL variable?

castarco commented 3 years ago

I wouldn't go for bash, but for sh (and might be bash underneath), which is always a POSIX shell (also, bash might be not installed in some systems!).

I'm also using fish, and for now I'm writing something like that for my tasks:

[tool.poe.tasks]
task_name = "sh -c '[...]'"
nat-n commented 2 years ago

@Algirdyz Thanks again for the feedback.

A fix for this issue has just been released as 0.12.0