Skip to content

eval "$(pkgx ...)" does not behave as expected #1101

@Dunedubby

Description

@Dunedubby

Will edit with more details, but basically:

set -a; eval "$(pkgx +blah)"; set +a; blah does not always behave the same way as pkgx +blah blah

For example, set -a; eval "$(pkgx +curl)"; set +a; curl https://google.com produces a certificate error, while pkgx +curl curl https://google.com works fine (at least on my machine).

The problem seems to be due to the SSL_CERT_FILE environment variable, which becomes the same path twice in a row (with a separating colon). Something like: /Users/user/.pkgx/stuff/cert.pem:/Users/user/.pkgx/stuff/cert.pem. If you edit the variable to be just the single path /Users/user/.pkgx/stuff/cert.pem after set +a, curl begins to work on HTTPS links again.

The strange thing is though: if you run pkgx +curl echo $SSL_CERT_FILE, it does print out the double path. How does this work behind the scenes? Why does eval "$(pkgx ...)" behave differently from the one-liner?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions