Skip to content
Permalink
Browse files

feat(importer): allow the implementer to decide whether to override s…

…cripts or not

Fixes #112
  • Loading branch information
MarshallOfSound authored and malept committed Jan 31, 2017
1 parent c8b12fb commit f85e194fafd701abd07828ae27b4603c3916bb07
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/api/import.js
@@ -18,6 +18,7 @@ const d = debug('electron-forge:import');
* @typedef {Object} ImportOptions
* @property {string} [dir=process.cwd()] The path to the app to be imported
* @property {boolean} [interactive=false] Whether to use sensible defaults or prompt the user visually
* @property {boolean} [updateScripts=true] Whether to update the modules package.json scripts to be electron-forge commands
*/

/**
@@ -31,9 +32,10 @@ const d = debug('electron-forge:import');
* @return {Promise} Will resolve when the import process is complete
*/
export default async (providedOptions = {}) => {
const { dir, interactive } = Object.assign({
const { dir, interactive, updateScripts } = Object.assign({
dir: process.cwd(),
interactive: false,
updateScripts: true,
}, providedOptions);
asyncOra.interactive = interactive;

@@ -98,7 +100,7 @@ export default async (providedOptions = {}) => {
} else if (buildToolPackages[key]) {
const explanation = buildToolPackages[key];
// eslint-disable-next-line max-len
const shouldRemoveDependency = await confirmIfInteractive(interactive, `Do you want us to remove the "${key}" dependency in package.json? Electron Forge ${explanation}.`);
const shouldRemoveDependency = await confirmIfInteractive(interactive, `Do you want us to remove the "${key}" dependency in package.json? Electron Forge ${explanation}.`, updateScripts);

if (shouldRemoveDependency) {
delete packageJSON.dependencies[key];

0 comments on commit f85e194

Please sign in to comment.
You can’t perform that action at this time.