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 (#5686)
  • Loading branch information
mmaietta authored Mar 11, 2021
1 parent 5d01ea6 commit 8df250b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion 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 @@ -56,7 +57,11 @@ export class LinuxTargetHelper {
const sources = [platformSpecificBuildOptions.icon, config.mac?.icon ?? config.icon].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 8df250b

Please sign in to comment.