Skip to content

Commit

Permalink
feat(importer): import now sets the scripts section in package.json t…
Browse files Browse the repository at this point in the history
…o be forge scripts

Fixes #63
  • Loading branch information
MarshallOfSound authored and malept committed Jan 10, 2017
1 parent 9e2aefa commit cb01d40
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/api/import.js
Expand Up @@ -108,6 +108,15 @@ export default async (providedOptions = {}) => {
}
}

packageJSON.scripts = packageJSON.scripts || {};
d('reading current scripts object:', packageJSON.scripts);

packageJSON.scripts.start = 'electron-forge start';
packageJSON.scripts.package = 'electron-forge package';
packageJSON.scripts.make = 'electron-forge make';

d('forgified scripts object:', packageJSON.scripts);

const writeChanges = async () => {
await asyncOra('Writing modified package.json file', async () => {
await fs.writeFile(path.resolve(dir, 'package.json'), `${JSON.stringify(packageJSON, null, 2)}\n`);
Expand Down

0 comments on commit cb01d40

Please sign in to comment.