mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
refactor(forge.config): simplify getExtraResourcesForPlatform
This commit is contained in:
parent
2b83470de6
commit
62099abb29
@ -100,21 +100,20 @@ module.exports = {
|
||||
};
|
||||
|
||||
function getExtraResourcesForPlatform() {
|
||||
let resources = ["dump-db/", "./bin/tpl/anonymize-database.sql"];
|
||||
const scripts = ["trilium-portable", "trilium-safe-mode", "trilium-no-cert-check"];
|
||||
const resources = ["dump-db/", "./bin/tpl/anonymize-database.sql"];
|
||||
|
||||
const getScriptRessources = () => {
|
||||
const scripts = ["trilium-portable", "trilium-safe-mode", "trilium-no-cert-check"];
|
||||
const scriptExt = (process.platform === "win32") ? "bat" : "sh";
|
||||
return scripts.map(script => `./bin/tpl/${script}.${scriptExt}`);
|
||||
}
|
||||
|
||||
switch (process.platform) {
|
||||
case "win32":
|
||||
for (const script of scripts) {
|
||||
resources.push(`./bin/tpl/${script}.bat`);
|
||||
}
|
||||
break;
|
||||
case "darwin":
|
||||
resources.push(...getScriptRessources())
|
||||
break;
|
||||
case "linux":
|
||||
resources.push("images/app-icons/png/256x256.png");
|
||||
for (const script of scripts) {
|
||||
resources.push(`./bin/tpl/${script}.sh`);
|
||||
}
|
||||
resources.push(...getScriptRessources(), "images/app-icons/png/256x256.png");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user