From 94546454040076029a7dc37e1301e175dace6d47 Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Mon, 20 Sep 2021 19:23:02 -0500 Subject: [PATCH] Add funding, and fix help to say KDE also. --- menuitem.js | 20 ++++++++++++++++++++ package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/menuitem.js b/menuitem.js index 3f1034a..5349ec1 100755 --- a/menuitem.js +++ b/menuitem.js @@ -118,6 +118,7 @@ if (options.exec == null || options.exec.length === 0) { const info = loadFile(desktopFile); if (options.edit && !info._created) { spawnEditor(info._pathToDesktopFile); + spawnUpdateDB(info._pathToDesktopFile.replace(path.basename(info._pathToDesktopFile), '')); process.exit(0); } @@ -138,6 +139,7 @@ if (configureDesktopEntry(info)) { } else { console.log("Saved:", fileName); } + spawnUpdateDB(fileName.replace(path.basename(fileName), '')); } else { console.log("No Changes"); } @@ -146,6 +148,24 @@ if (configureDesktopEntry(info)) { // Support Functions // ------------------------------------------------------------------------------------------------- +/** + * Spawns the Update desktop database for Mime-types* + * @param path + */ +function spawnUpdateDB(path) { + console.log(path); + const updater = ['/usr/bin/update-desktop-database']; + for (let i=0;i