-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
CYPRESS_DOWNLOAD_PATH_TEMPLATE only replace placeholder once #23670
Comments
Docs for this feature (didn't know this was a thing): https://docs.cypress.io/guides/references/advanced-installation I'm still confused, though. What is the |
I think this works just fine, though. I installed the latest version (v10.7.0). Then I did
It's weird since you are installing a specific binary - so you've got a different cli version (the thing in Let me know if I'm missing something, but it looks like this works as expected. I will re-open if there's more information. |
Hi, Problem: I'm behind a firewall at our company. Automatic downloading of many binaries is prohibited. Also, we use an internal path/filename format used by other companies, e.g So I can't use your mirror https://cdn.cypress.io inside the CYPRESS_DOWNLOAD_PATH_TEMPLATE. http://tkeasydev.dst.tk-inline.net is an internal domain. You cannot access it from the outside. Before CYPRESS_DOWNLOAD_PATH_TEMPLATE, we use CYPRESS_INSTALL_BINARY with a hard-coded URI and version, and we often forgot to update this path as well when newer versions of Cypess were installed. So I'm grateful to have an option with dynamic/viriable parameters. If replacing using the same variable multiple times is not an option for you, the only workaround I see is to change our internal storage format. Thx |
Right, I understand the problem now. I think we just need to use a regex here instead of If you'd like to make a PR, that'd be great! I'm going to mark this as an good first issue, so either someone can pick it up now, or it can go into our backlog for internal prioritization. |
Hi, forking and running the repo on my windows machine fails completely. And yes I'm looking at CONTRIBUTING.md. The fix is very simple: cypress/cli/lib/tasks/download.js Lines 71 to 74 in 9cdb33b
to this .replace(/\\?\$\{endpoint\}/g, endpoint)
.replace(/\\?\$\{platform\}/g, platform)
.replace(/\\?\$\{arch\}/g, arch)
.replace(/\\?\$\{version\}/g, version) Also a test should be add after this cypress/cli/test/lib/tasks/download_spec.js Lines 77 to 83 in 9cdb33b
it('returns custom url from template with multiple replacements', () => {
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '${endpoint}/v${version}/${platform}/${arch}/cypress-${version}-${platform}-${arch}.zip'
const url = download.getUrl('ARCH', '0.20.2')
snapshot('desktop url from template with multiple variables', normalize(url))
}) Hope it helps. |
I've done development on Windows (CI also running on windows). If you'd like to become a contributor, happy to work through getting your environment setup - if you just want this fixed asap, I can grab your above fix and integrate it, if you like. Let me know what works for you! |
Hey @nagash77 , could you please assign it to me? |
@mahdikhashan done, I also set the status to "Contributor PR in Progress" so someone should be able to review it for you. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
Desired behavior
Test code to reproduce
no test available
failed on npm i
Cypress Version
10.7.0
Node version
18.8.0
Operating System
Win 10
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: