nushell / nushell.github.io

Nushell's main website, blog, book, and more
https://www.nushell.sh/book/
MIT License
162 stars 400 forks source link

Add reference to bash-env to cookbook #1434

Closed tesujimath closed 1 month ago

tesujimath commented 1 month ago

Using bash-env is a lot simpler than using the convoluted work-arounds currently described there.

fdncred commented 1 month ago

I'm not sure how I feel pushing other tools here in the cookbook. The real intent of the cookbook is to teach people how to use nushell, not how to work-around nushell.

tesujimath commented 1 month ago

The problem here is that the cookbook makes it look quite awkward to use Bash environment, but that's not the case with the plugin.

I noticed also on a discussion that people have been wasting time solving this very same problem.

I encourage you to embrace the wider community contributions, so that all will benefit.

(I was careful to describe the plugin as third-party BTW.)

Alternatively, you could simply remove the description of importing Bash environment and integrating with ssh-agent, as those descriptions are no longer best practice, and are in fact misleading IMO.

fdncred commented 1 month ago

My comments aren't an indictment on your plugin but more of a comment about our documentation and the support we provide. If it's in our documentation people will ask us to support it, so we need to be careful about which external tools we allow in our documentation since we already have a hard time supporting everything nushell does. This may be able to be addressed by having some warning statement saying that questions regarding your plugin should be addressed in your repo.

Your plugin also uses jq which could be seen as a competitor to nushell in some respects. I wonder if it could be created without external dependencies like this.

One thing that I do love about your plugin is that it's written in a scripting language other than nushell. I'm not sure if you've seen it but devyn recently created a plugin written in nushell script. I'd personally love to see plugins written in several languages.

tesujimath commented 1 month ago

Totally understand your concern about implying it is supported by the core Nushell team. Have pushed up a very clear statement about that.

Regarding the use of jq, I don't think there's a reasonable alternative. Trying to parse JSON with raw bash would be error prone and quite unworkable I think. Using Nu itself would be really heavyweight for something for which jq is absolutely the right tool. In Nu land, jq is obsolete. But this plugin doesn't run in Nu land, it runs outside.

The very nature of the bash-env plugin is that it has to be written in Bash. Everything else follows on from that.