add dev rules

This commit is contained in:
olcxja 2026-09-30 19:16:52 +02:00
commit 944d8f86c2
9 changed files with 112 additions and 27 deletions

View file

@ -114,6 +114,22 @@ function resolvePortablePath(p) {
return path.join(FILES, p)
}
// The launcher's own icon (renderer/plwl.png), used by the tray, the app
// icon and as the .desktop shortcut fallback. Cached: it never moves at
// runtime.
let launcherIcon = null
function launcherIconPath() {
if (launcherIcon === null) {
const p = path.join(APP_ROOT, 'renderer', 'plwl.png')
try {
launcherIcon = fs.existsSync(p) ? p : ''
} catch {
launcherIcon = ''
}
}
return launcherIcon || null
}
function readJson(file, fallback) {
try {
return JSON.parse(fs.readFileSync(file, 'utf8'))
@ -129,4 +145,4 @@ function writeJson(file, data) {
fs.renameSync(tmp, file)
}
module.exports = { RESOURCES, APP_ROOT, BUILD, FILES, DATA, DIRS, ensureDirs, syncBundledTranslations, readJson, writeJson, toPortablePath, resolvePortablePath }
module.exports = { RESOURCES, APP_ROOT, BUILD, FILES, DATA, DIRS, ensureDirs, syncBundledTranslations, launcherIconPath, readJson, writeJson, toPortablePath, resolvePortablePath }