From ec8b9a29ada9adf5e0d2df62c4af3b4fda0debd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Maih=C3=B6fer?= Date: Mon, 25 Nov 2024 15:36:49 +0100 Subject: [PATCH] no duplicate dependencies --- src/electron/electron_api.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/electron/electron_api.js b/src/electron/electron_api.js index 88eda0d..902283f 100644 --- a/src/electron/electron_api.js +++ b/src/electron/electron_api.js @@ -1582,7 +1582,10 @@ class ElectronApi if (opDoc) { const deps = opDoc.dependencies || []; - deps.push(dep); + if (!deps.some((d) => { return d.name === dep.name && d.name === dep.name; })) + { + deps.push(dep); + } opDoc.dependencies = deps; opDoc = doc.cleanOpDocData(opDoc); jsonfile.writeFileSync(opDocFile, opDoc, { "encoding": "utf-8", "spaces": 4 }); @@ -1619,7 +1622,8 @@ class ElectronApi opDoc.dependencies = newDeps; if (opDoc.dependencies) jsonfile.writeFileSync(opDocFile, opDoc, { "encoding": "utf-8", "spaces": 4 }); doc.updateOpDocs(); - return this._installOpDependencies(opName); + this._installOpDependencies(opName); + return this.success("OK"); } else {