-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: allow the usage of environment variables #83
Conversation
Just tested on my local machine... reading from the environment variables works as expected. Line 398 in 66349dd
works as intended.... The dotenv module should not be needed for that. It is required to read from .env files. So please if you have issues with the cli to read your environment variables, create a minimal reproducible example so we can investigate. |
I'm not sure how a minimal reproduction would look for this issue? here are my scripts "i18n:download": "locize download --clean=true --path=./public/locales",
"i18n:sync": "locize sync --path=./public/locales --dry=true" and my env LOCIZE_PROJECTID="my-project-id"
LOCIZE_API_KEY="my-api-key"
LOCIZE_LANGUAGE="en-GB"
LOCIZE_VERSION="latest" I think this is really specific to a developers local environment (machine), and the Anyhow, I patched it for our environments to include the |
If you could provide an example repository or a Docker image or similar that would be awesome. |
@adrai here is a reproduction with a docker example, it does the same in the docker, git clone https://github.com/paul-vd/locize-cli-reproduction &&
cd locize-cli-reproduction &&
docker build . After adding the patch that I have done, it works correctly, you can test this by uncommenting the line 12 in the Docker file and running |
@paul-vd We've just published v7.14.0 that should also respect the default .env file, but we've implemented it in a different way. Can you check if that's ok for you? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Looks good to me! I will close this one, thanks! |
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
locize-cli@7.13.2
for the project I'm working on.In the documentation it states that if environment variables are set, they will be used if no arguments are passed or no locize config.
But they seem to have been missing when running the CLI, I received:
error: missing required argument 'apiKey'
Here is the diff that solved my problem:
Checklist
npm run test
Related issue : #69