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

extraMetadata not working on Windows #8583

Open
rafaellehmkuhl opened this issue Oct 10, 2024 · 2 comments
Open

extraMetadata not working on Windows #8583

rafaellehmkuhl opened this issue Oct 10, 2024 · 2 comments

Comments

@rafaellehmkuhl
Copy link

  • Electron-Builder Version: 24.13.3
  • Node Version: 21.7.1
  • Electron Version: 29.2.0
  • Electron Type (current, beta, nightly): current
  • Electron updater: electron-updater v6.3.9
  • Target: macos, linux and windows

I'm trying to inject the package version with electron-builder using the following: electron-builder --publish=never -c.mextraMetadata.version=1.3.0. This works perfectly on both the macos and linux builds, but on the windows build I receive the following:

Run bun deploy:electron -c.extraMetadata.version=1.3.0
  bun deploy:electron -c.extraMetadata.version=1.3.0
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
$ electron-builder --publish=never -c .extraMetadata.version=1.3.0
  • electron-builder  version=[2](https://github.com/bluerobotics/cockpit/actions/runs/11282022986/job/31378628325#step:8:2)5.1.8 os=10.0.20348
  ⨯ ENOENT: no such file or directory, open 'D:\a\cockpit\cockpit\.extraMetadata.version=1.[3](https://github.com/bluerobotics/cockpit/actions/runs/11282022986/job/31378628325#step:8:3).0'  failedTask=build stackTrace=Error: ENOENT: no such file or directory, open 'D:\a\cockpit\cockpit\.extraMetadata.version=1.3.0'

This can be directly confirmed here.

Am I using the command wrong or is it a bug?

@mmaietta
Copy link
Collaborator

Your command is getting split between the -c and .extraMetadata, so the -c is being interpreted as the --config/-c arg

Not sure what bun is doing, but it looks like it's parsing your cmd line args in a problematic manner.

An alternative route is to use the extraMetadata property in an electron-builder config. The .js/.ts config files can accept process.env vars for instance

@rafaellehmkuhl
Copy link
Author

Thanks for the tip!

Unfortunately the same is happenning if I use npx instead. Any idea?

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