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 8, 2021
1 parent 0b03f10 commit 32a592c
Showing 1 changed file with 6 additions and 4 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

0 comments on commit 32a592c

Please sign in to comment.