-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
Update downloadsUrl to prioritize .npmrc variable #126
Conversation
This commit updates the `downloadsUrl` variable to prioritize the value from the `.npmrc` file if it exists. The updated code checks `process.env.npm_config_ffmpeg_binaries_url` first and if it's not set, then it falls back to `process.env[BINARIES_URL_ENV_VAR]` or the default value if none of the variables are set. This change allows for more flexibility and customization when it comes to configuring the download URL for ffmpeg binaries.
Thanks for the contribution! Can you tell me about the use case? Why is passing in |
Thank you for reviewing this PR. In my project, there are team members from China who have restricted access to GitHub and are using different operating systems. In order to install dependencies, we need to set the $FFPROBE_BINARIES_URL before running npm install to ensure that FFMPEG binaries can be downloaded from a mirror site. However, writing complex scripts to handle environment variable settings for each system is a time-consuming task. To optimize this process, I have used the .npmrc file to easily configure the FFPROBE_BINARIES_URL option. This approach is simpler and customizable, allowing for easy configuration of the download URL for ffmpeg binaries. |
Lines 169 to 174 in 7407c14
|
Lines 167 to 172 in 7407c14
I think |
I think there's some confusion here.
This means that, when installing Is this PR's intention to allow permanently changing (system-wide) |
I apologize for any misunderstanding caused by the translation software, as my English is not very good. The reason I raised this PR is simply because .npmrc is easier to set up than environment variables. |
If you add an entry to |
This commit updates the
downloadsUrl
variable to prioritize the value from the.npmrc
file if it exists. The updated code checksprocess.env.npm_config_ffmpeg_binaries_url
first and if it's not set, then it falls back toprocess.env[BINARIES_URL_ENV_VAR]
or the default value if none of the variables are set. This change allows for more flexibility and customization when it comes to configuring the download URL for ffmpeg binaries.