ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
539 stars 129 forks source link

Strip `export ` lines to make it `shell` compatible #117

Closed scharf closed 1 year ago

scharf commented 4 years ago

fixes #102

The lookahead (?=\\w)ensures that the pathological case of a variable called export is not accidentally destroyed: export = foo is not changed by the regex, but export foo=bar becomes foo=bar.

jsommr commented 3 years ago

Oh my god this needs to be merged and put in a release as soon as possible!

ashald commented 3 years ago

I appreciate the effort but I have no intention of merging this change. To the best of my knowledge - proposed behavior is not in line with how .env files are handled by other systems processing them. Moreover, there is a documented workaround for such a use-case https://github.com/ashald/EnvFile#bash-workaround

That being said, I"d be open to consider alternative ideas how we can support aforementioned usecase. Or if this behavior was protected by a feature toggle.

ashald commented 1 year ago

I'm positive on having this in the plugin, but I think regex is overkill. Given that we strip the line, we should be fine just trimming export.

ashald commented 1 year ago

Released this in 3.4.0