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: Remove adapter if core22 is set as base on snapcraft #7378

Merged
merged 2 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thin-terms-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": major
---

Remove extra adapter field if core22 is set as base for snapcraft
4 changes: 4 additions & 0 deletions packages/app-builder-lib/src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export default class SnapTarget extends Target {
}
if (options.base != null) {
snap.base = options.base
// from core22 onwards adapter is legacy
if (Number(snap.base.split("core")[1]) >= 22) {
delete appDescriptor.adapter
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to future-proof this for core22+? This feels too hardcoded to me. Perhaps we can extract the number from core__ and compare >= 22, what are your thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. We can change it to something like Number(snap.base.split("core")[1]) >= 22 instead?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That sounds perfect.

}
}
if (options.grade != null) {
snap.grade = options.grade
Expand Down