aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/packages.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/packages.js b/src/modules/packages.js
index 12659fe..317f0b0 100644
--- a/src/modules/packages.js
+++ b/src/modules/packages.js
@@ -1,7 +1,7 @@
const path = require("path");
const fs = require("fs-extra");
const unzip = require("unzipper");
-const app = require("electron").app;
+const { app, ipcMain } = require("electron");
const https = require("follow-redirects").https;
const json = require("./json");
@@ -203,6 +203,8 @@ packages.install = async (url, author, package_name, version) => {
}
break;
default:
+ ipcMain.emit("failed-mod", name);
+
// other unhandled error
return console.log(
"Verification of package failed:", name,
@@ -233,10 +235,16 @@ packages.install = async (url, author, package_name, version) => {
let moved = packages.move(package_path);
if (! moved) {
+ ipcMain.emit("failed-mod", name);
console.log("Moving package failed:", name);
return false;
}
+ ipcMain.emit("installed-mod", "", {
+ name: name,
+ fancy_name: package_name
+ })
+
console.log("Installed package:", name);
return true;
}