Skip to content

Commit

Permalink
feat(importer): delete existing Electron build tools from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Dec 30, 2016
1 parent bac8680 commit 4152bd2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/electron-forge-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,27 @@ const main = async () => {
packageJSON.devDependencies = packageJSON.devDependencies || {};

const keys = Object.keys(packageJSON.dependencies).concat(Object.keys(packageJSON.devDependencies));
const buildToolPackages = [
'electron-builder',
'electron-download',
'electron-installer-debian',
'electron-installer-dmg',
'electron-installer-flatpak',
'electron-installer-redhat',
'electron-osx-sign',
'electron-packager',
'electron-winstaller',
];

let electronName;
for (const key of keys) {
if (key === 'electron' || key === 'electron-prebuilt') {
delete packageJSON.dependencies[key];
delete packageJSON.devDependencies[key];
electronName = key;
} else if (buildToolPackages.includes(key)) {
delete packageJSON.dependencies[key];
delete packageJSON.devDependencies[key];
}
}

Expand Down

0 comments on commit 4152bd2

Please sign in to comment.