elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.67k stars 299 forks source link

Allow changing the module search path #833

Open href opened 5 years ago

href commented 5 years ago

I'd like to use elvish for some basic scripts in some Docker containers. Naturally I don't have a ~/.elvish/lib folder at hand, so I was wondering if there's a way to override the lookup path for modules.

Ideally I would like to pass it to elvish (e.g. elvish -modules-path=/opt/elvish-modules) so I can write reusable code and import it with use. It might make sense to apply the same to rc.elv, but for my purposes that would not be necessary.

If there's a way to do this already, I cannot find it.

This would be very handy for Elvish in general, as I have tons of bash scripts throughout our infrastructre that I'd rather write in Elvish 😉

xiaq commented 5 years ago

Elvish doesn't have that API but it sounds like a good idea.