oh-my-fish / plugin-foreign-env

Run foreign bash scripts and capture exported environment variables
MIT License
221 stars 15 forks source link

How does foreign-env import function from bash and why nvm need sourced every time ? #26

Closed haoadoreorange closed 2 years ago

haoadoreorange commented 2 years ago

First I'm sorry if this isn't the right place to ask.

I'm trying to learn how to interact between bash and fish, and this plugin is an excellent example, it behaves very similar to bass. I can't understand how foreign-env import bash functions to fish when sourcing a file, I thought it should read and redefine the functions in fish but it's not the case, for example for nvm use case.

And then, providing that foreign-env import the function to fish, why do we need to source everytime we run nvm ? Isn't sourcing on first session enough ?