add dev rules
This commit is contained in:
parent
6f9c486774
commit
944d8f86c2
9 changed files with 112 additions and 27 deletions
18
src/paths.js
18
src/paths.js
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue