Skip to content

Commit

Permalink
fix: (#5685) check if icons subdir exists in build resources, otherwi…
Browse files Browse the repository at this point in the history
…se don't prepend it to fallback sources
  • Loading branch information
Mike Maietta committed Mar 9, 2021
1 parent 0b03f10 commit 2f00746
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions packages/app-builder-lib/src/targets/LinuxTargetHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Lazy } from "lazy-val"
import { LinuxTargetSpecificOptions } from ".."
import { LinuxPackager } from "../linuxPackager"
import { IconInfo } from "../platformPackager"
import { join } from "path";

export const installPrefix = "/opt"

Expand Down Expand Up @@ -60,10 +61,11 @@ export class LinuxTargetHelper {
].filter(str => !!str) as string[]

// If no explicit sources are defined, fallback to buildResources directory, then default framework icon
const fallbackSources = [
config.directories?.buildResources,
...asArray(packager.getDefaultFrameworkIcon())
].filter(async filepath => filepath && await exists(filepath)) as string[]
let fallbackSources = [...asArray(packager.getDefaultFrameworkIcon())]
const buildResources = config.directories?.buildResources
if (buildResources && await exists(join(buildResources, 'icons'))) {
fallbackSources = [buildResources, ...fallbackSources]
}

// need to put here and not as default because need to resolve image size
const result = await packager.resolveIcon(sources, fallbackSources, "set")
Expand Down
2 changes: 1 addition & 1 deletion test/snapshots/BuildTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ Object {
"size": 1069,
},
"abi_registry.json": Object {
"size": 1742,
"size": 1732,
},
"index.js": Object {
"size": 6099,
Expand Down

0 comments on commit 2f00746

Please sign in to comment.