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

Setting environment variables for a command #13

Closed
NickDarvey opened this issue Sep 15, 2021 · 2 comments
Closed

Setting environment variables for a command #13

NickDarvey opened this issue Sep 15, 2021 · 2 comments

Comments

@NickDarvey
Copy link

I understand I can use environment variables in command parameters, but is there a way to specify environment variables?

My use case is setting TS_NODE_PROJECT to point ts-node to a tsconfig.json.

@zanaptak
Copy link
Owner

No, not directly in the type provider. I would recommend using a script (node, bash, powershell, etc.) to set up the environment and call your command. For example see the FableTailwind sample, where we could have hypothetically called the Tailwind CLI directly, but instead we are calling a tailwind-process.js script and passing in a config filename. You could do something similar and set environment variables as needed from the script arguments.

@NickDarvey
Copy link
Author

Makes sense, thanks @zanaptak

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