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