oh-my-fish / plugin-foreign-env

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

handle parentheses "(foo)" in env var #4

Closed jab closed 8 years ago

jab commented 8 years ago

Given foo.sh:

export FOO="(bar)"

It looks like fenv source foo.sh will attempt to run bar in a subshell rather than interpret it literally:

⋊> fenv source foo.sh                                              11:20:38
fish: Unknown command 'bar'
- (line 1): bar
            ^
in command substitution
    called on line -1 of file -

from sourcing file -
    called on line 60 of file /usr/local/Cellar/fish/2.2.0/share/fish/functions/eval.fish

in function 'eval'
    called on line 37 of file ~/.local/share/omf/pkg/foreign-env/fenv.apply.fish

in function 'fenv.apply'
    called on line 43 of file ~/.local/share/omf/pkg/foreign-env/fenv.main.fish
    with parameter list 'FOO=(bar)'

in function 'fenv.main'
    called on line 26 of file ~/.local/share/omf/pkg/foreign-env/fenv.fish
    with parameter list 'source foo.sh'

in function 'fenv'
    called on standard input
    with parameter list 'source foo.sh'

Is it possible to get fenv to handle this without having to work around it in foo.sh?