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

Injecting version into package.json should start early #8678

Open
cawa-93 opened this issue Nov 12, 2024 · 2 comments
Open

Injecting version into package.json should start early #8678

cawa-93 opened this issue Nov 12, 2024 · 2 comments

Comments

@cawa-93
Copy link
Contributor

cawa-93 commented Nov 12, 2024

  • Electron-Builder Version: 26.0.0-alpha.6
  • Node Version: 23.0.0
  • Target: Windows

I'm trying to inject app version on compile stage. I have a package.json with major.minor version part and compile app like so:

electron-builder build -c.extraMetadata.version=$MAJOR.$MINOR.$DYNAMICALLY_CALCULATED_PATCH

The final command may look like this:

electron-builder build --config electron-builder.mjs --publish never -c.extraMetadata.version=3.1.1731434857-vanilla-ts

But it fails with error:

Invalid version: "3.1"  failedTask=build stackTrace=Error: Invalid version: "3.1"

As I assume, version checking happens before all injections into the package.json

@mmaietta
Copy link
Collaborator

Curious, why not just set the package.json version to major.minor.0? Your c.extraMetadata.version will override it anyways later on

@cawa-93
Copy link
Contributor Author

cawa-93 commented Nov 14, 2024

Yeap. I can do that. But It's just not intuitive. If I inject the version, I expect it to be validated.

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