EnvFile icon indicating copy to clipboard operation
EnvFile copied to clipboard

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

Open scharf opened this issue 4 years ago • 2 comments

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.

scharf avatar Jun 30 '20 23:06 scharf

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

jsommr avatar Dec 08 '20 19:12 jsommr

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 avatar Sep 02 '21 03:09 ashald

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 avatar Oct 02 '22 07:10 ashald

Released this in 3.4.0

ashald avatar Oct 03 '22 07:10 ashald