Skip to content

Commit

Permalink
no duplicate dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
steam0r committed Nov 25, 2024
1 parent 6e8efd2 commit ec8b9a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/electron/electron_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit ec8b9a2

Please sign in to comment.