kvz / environmental

Node project that aims to provide code and conventions to deal with environment vars for configuration in a structured, reusable, pleasant way
https://www.npmjs.org/package/environmental
MIT License
13 stars 1 forks source link

Making it work on zsh #20

Closed lgomez closed 8 years ago

lgomez commented 8 years ago

These changes have made this module work for me under zsh and bash. Haven't really tested if changing DEBUG=*.* to DEBUG=".*." had any effect but the #19 seems to be solved by this.

kvz commented 8 years ago

Thanks! I'm not sure if it still works in bash now tho? I think we're missing out on the [0]?

__dir="$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd)"
lgomez commented 8 years ago

It does work for me locally when I switch to bash. Did it not work for you?

kvz commented 8 years ago

I haven't tried it yet to be honest, but looking at the code I believe trouble arises when using more sources. [0] is lost in your pr, meaning for a single source, nothing changes, but for multiple, things start falling apart. I googled a bit and this page seems to illustrate my concern

http://hustoknow.blogspot.nl/2011/01/what-bashsource-does.html