-
Notifications
You must be signed in to change notification settings - Fork 11
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
Load env variables from .env #18
Comments
supporting dotenv would probably be most logical right? |
yeah I think that would be best. If I have some time later, I'll add it but I can't promise. |
If you've got a repo that uses I am thinking of at least CreateReactApp and NextJS apps. There's like a whole hierarchy for which files to use when... Maybe ".env" located inside the required DOTENV specifically advises against having multiple env files, but when a single repo comprises dev tools, node server code, and browser app code, I feel like it's kindof inevitable. So conflicts and preferences should be accounted for. |
Those are good points @ptpaterson. I might opt to make it configurable as well via the fauna migrate config that is already there. Some users might want to use the same FAUNA admin key and don't want to have two .env files. The default probably should go in the fauna folder. Would also make it easy to generate it initially, considering adding an option in the init to generate that file. |
Maybe there are better variations on this, but I was experimenting with a temporary workaround, adding this script to "scripts": {
"fauna-schema-migrate": "DOTENV_CONFIG_PATH=./.env node -r dotenv/config ./node_modules/@fauna-labs/fauna-schema-migrate/dist/cli.js"
}, Then run with: npm run fauna-schema-migrate apply and it will apply the config from a |
You could export them before running any command but I think it would be nice to load them from a .env file for convenience.
Maybe even specify the path and/or variable names in
.fauna-migrate.js
:)The text was updated successfully, but these errors were encountered: