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

fix: msiWrapped: Normalize target names before checking for NSIS target #7529

Conversation

NoahAndrews
Copy link
Contributor

Target names are not case sensitive, and are normalized by this function:

function normalizeTargets(targets: Array<string>, defaultTarget: Array<string>): Array<string> {
const list: Array<string> = []
for (const t of targets) {
const name = t.toLowerCase().trim()
if (name === DEFAULT_TARGET) {
list.push(...defaultTarget)
} else {
list.push(name)
}
}
return list
}

This PR makes it so that the msiWrapped target doesn't complain when the nsis target has leading/trailing spaces or is not all-lowercase.

@changeset-bot
Copy link

changeset-bot bot commented Apr 6, 2023

🦋 Changeset detected

Latest commit: 2f2618f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
electron-builder Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Apr 6, 2023

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit 2f2618f
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/642f4a2e2492f30008e867cb
😎 Deploy Preview https://deploy-preview-7529--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 7, 2023

Sorry, I'm confused. Why do we need to allow multi-case such as NSIS allowed?

@NoahAndrews
Copy link
Contributor Author

We don't really need to, but we should be consistent. If you're just configuring NSIS, using all-caps NSIS works. If you want to also add msiWrapped, now you get an error unless you change NSIS to nsis.

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label May 8, 2023
@NoahAndrews
Copy link
Contributor Author

NoahAndrews commented May 8, 2023

@mmaietta Do you plan to review this eventually? It's a pretty confusing DX right now if you have a working setup that has an NSIS configuration block (matching the capitalization of the tool), and then you want to build a wrapped MSI and it tells you it can't find the configuration block that you know for a fact is there and is being used.

@mmaietta mmaietta merged commit 60eb555 into electron-userland:master May 8, 2023
11 of 12 checks passed
@github-actions github-actions bot mentioned this pull request May 8, 2023
@NoahAndrews NoahAndrews deleted the msiWrapped-find-nsis-config-case-insensitive branch May 9, 2023 15:02
@NoahAndrews
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants