basherpm / basher

A package manager for shell scripts.
https://www.basher.it/
MIT License
1.16k stars 74 forks source link

Fix detect shell test on Git Bash #75

Closed klieber closed 3 years ago

klieber commented 4 years ago

The version of the ps command that comes with Git Bash for Windows does not support the -o flag so running basher init - results in the following printed to stderr:

ps: unknown option -- o
Try `ps --help' for more information.

Redirecting stderr seems to allow it to work appropriately.

juanibiapina commented 4 years ago

If the -o option is not available, the ps command should be simply failing. I don't think we should move forward with this solution because it can cause unexpected things to happen later. We can try to find a platform agnostic way (check what rbenv does, for instance) or handle the failure more clearly (with an if condition and comments explaining what could happen).

It might be even better to get rid of all these external process calls altogether and get the name of the shell from the command line arguments. This would make the setup slightly different per shell, but faster and simpler.

juanibiapina commented 4 years ago

The newest version should not have this problem, but has a backwards incompatible change. Sorry about that. It might be time to start versioning.

juanibiapina commented 3 years ago

Shell detection is now removed.