Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI env not detected #65

Closed
gerukin opened this issue Sep 11, 2021 · 1 comment
Closed

CLI env not detected #65

gerukin opened this issue Sep 11, 2021 · 1 comment

Comments

@gerukin
Copy link

gerukin commented Sep 11, 2021

I have the following structure:

-- env
  |_ .env
  |_ prod.env               (API_URL=https://some.thing)
-- requests
  |_ something.http         (uses {{API_URL}})
-- package.json             (just script definitions)

When I run:

httpyac --env prod --all ./requests

I get:

ReplaceVariableHook: javascript failed
ExecuteHook: variableReplacer failed
ReferenceError: API_URL is not defined
    at Object.<anonymous> (requests/something.http:6:20)
    at Object.<anonymous> (~/.nvm/versions/node/v16.5.0/lib/node_modules/httpyac/dist/index.js:1:141494)
    at Generator.next (<anonymous>)
    at ~/.nvm/versions/node/v16.5.0/lib/node_modules/httpyac/dist/index.js:1:139999
    at new Promise (<anonymous>)
    at r (~/.nvm/versions/node/v16.5.0/lib/node_modules/httpyac/dist/index.js:1:139744)
    at Object.t.runScript ~/.nvm/versions/node/v16.5.0/lib/node_modules/httpyac/dist/index.js:1:141083)
    at Object.<anonymous> (~/.nvm/versions/node/v16.5.0/lib/node_modules/httpyac/dist/index.js:1:165669)
    at Generator.next (<anonymous>)
    at ~/.nvm/versions/node/v16.5.0/lib/node_modules/httpyac/dist/index.js:1:165188

It used to work before as far as I remember. And the environment is still correctly picked up by the vscode extension (and everything runs fine there). It's just the CLI which no longer works.

I'm using httpyac v3.1.0 (unfortunately I don't remember what version it used to work on but I'm pretty sure I haven't changed my directory structure since it last worked). 🤔

AnWeber added a commit to httpyac/httpyac.github.io that referenced this issue Sep 12, 2021
@AnWeber
Copy link
Owner

AnWeber commented Sep 12, 2021

The environment was unfortunately not passed correctly by the cli in to the logic adapted for the extension.
The bug will be fixed with the next version.

@AnWeber AnWeber closed this as completed Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants