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

Don't overwrite all options previously specified when manifest is found (assign re-defined only) #1263

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Black-Platypus
Copy link
Contributor

Keep anything the user specified in the options object and only overwrite things found in any manifest (package.json) found.

  • Assign manifest.app to options.app
  • Assign manifest to options
  • Restore options.app

Fixes: #1261

@@ -43,11 +43,15 @@ async function nwbuild(options) {

try {
// Parse options
options = await util.parse(options, manifest);
Copy link
Collaborator

@ayushmanchhabra ayushmanchhabra Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember why I did this. If options.srcDir or options.glob is undefined, then getNodeManifest function will throw an error. This is why the parse function is called twice. If there's a better way to go about this, I'm all ears

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayushmanchhabra
Copy link
Collaborator

Keep anything the user specified in the options object and only overwrite things found in any manifest (package.json) found.

Also nothing should be overwritten. If an option is undefined, the default value is used for it. If an option is being overwritten, then its probably an error in the parse function.

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

Successfully merging this pull request may close these issues.

Don't discard information previously set by user when some nwbuilder manifest is found
2 participants