Skip to content

Commit

Permalink
fix: flatpak build failing due to too large icons (#7875)
Browse files Browse the repository at this point in the history
  • Loading branch information
achim-k committed Nov 13, 2023
1 parent 3f6757b commit 9883ab6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-cheetahs-move.md
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix: flatpak build fails due to too large icons
4 changes: 4 additions & 0 deletions packages/app-builder-lib/src/targets/FlatpakTarget.ts
Expand Up @@ -82,6 +82,10 @@ export default class FlatpakTarget extends Target {
private async copyIcons(stageDir: StageDir) {
const icons = await this.helper.icons
const copyIcons = icons.map(async icon => {
if (icon.size > 512) {
// Flatpak does not allow icons larger than 512 pixels
return Promise.resolve();

Check warning on line 87 in packages/app-builder-lib/src/targets/FlatpakTarget.ts

View workflow job for this annotation

GitHub Actions / test-linux (ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configura...

Delete `;`

Check warning on line 87 in packages/app-builder-lib/src/targets/FlatpakTarget.ts

View workflow job for this annotation

GitHub Actions / test-linux (snapTest,debTest,fpmTest,protonTest)

Delete `;`
}
const extWithDot = path.extname(icon.file)
const sizeName = extWithDot === ".svg" ? "scalable" : `${icon.size}x${icon.size}`
const iconDst = stageDir.getTempFile(path.join("share", "icons", "hicolor", sizeName, "apps", `${this.appId}${extWithDot}`))
Expand Down

0 comments on commit 9883ab6

Please sign in to comment.