File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
plugins/plugin-codeflare/src/tray Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,17 @@ import gettingStarted from "@kui-shell/client/icons/png/gettingStartedTemplate.p
2626
2727import { join } from "path"
2828
29- const iconHome = process . env . CODEFLARE_HEADLESS || join ( process . argv0 , "../../Resources/app/dist/headless" )
29+ function resources ( ) {
30+ return process . platform === "darwin" ? join ( process . argv0 , "../../Resources" ) : join ( process . argv0 , "../resources" )
31+ }
32+
33+ export function iconHome ( ) {
34+ return process . env . CODEFLARE_HEADLESS || join ( resources ( ) , "app/dist/headless" )
35+ }
3036
3137/** Resize and templatize, so that the icon morphs with platform color themes */
3238function iconFor ( filepath : string ) {
33- return join ( iconHome , filepath )
39+ return join ( iconHome ( ) , filepath )
3440}
3541
3642export const rayIcon = iconFor ( ray )
Original file line number Diff line number Diff line change 1717import { join } from "path"
1818import { CreateWindowFunction } from "@kui-shell/core"
1919
20+ import { iconHome } from "./icons"
2021import buildContextMenu from "./menus"
2122import { productName } from "@kui-shell/client/config.d/name.json"
2223
@@ -87,18 +88,13 @@ export default async function main(createWindow: CreateWindowFunction) {
8788 try {
8889 const { Tray } = await import ( "electron" )
8990
90- const iconHome = process . env . CODEFLARE_HEADLESS || join ( process . argv0 , "../../Resources/app/dist/headless" )
91- if ( iconHome ) {
92- // this forces webpack to include the @2x template images in
93- // the build
94- // eslint-disable-next-line @typescript-eslint/no-unused-vars
95- const fake = "dist/headless/" + icon2x
91+ // this forces webpack to include the @2x template images in
92+ // the build
93+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
94+ const fake = "dist/headless/" + icon2x
9695
97- tray = new Tray ( join ( iconHome , icon ) )
98- new LiveMenu ( tray , createWindow )
99- } else {
100- console . error ( "Cannot register electron tray menu, because CODEFLARE_HEADLESS environment variable is absent" )
101- }
96+ tray = new Tray ( join ( iconHome ( ) , icon ) )
97+ new LiveMenu ( tray , createWindow )
10298 } catch ( err ) {
10399 console . error ( "Error registering electron tray menu" , err )
104100 }
You can’t perform that action at this time.
0 commit comments