Skip to content

Commit

Permalink
Copy node_modules if the directory exists
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Dec 18, 2018
1 parent 4694547 commit dacf624
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions bin/create
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ if (argv.argv.remain[2]) config.setName(argv.argv.remain[2]);
var options = {
cli: argv.cli,
link: argv.link || argv.shared,
customTemplate: argv.argv.remain[3],
copyPlatformNodeModules: true
customTemplate: argv.argv.remain[3]
};

require('./templates/scripts/cordova/loggingHelper').adjustLoggerLevel(argv);
Expand Down
4 changes: 3 additions & 1 deletion bin/lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ function copyScripts (projectPath, projectName, options) {
// Copy in the new ones.
var binDir = path.join(ROOT, 'bin');
shell.cp('-r', srcScriptsDir, projectPath);
if (options.copyPlatformNodeModules) shell.cp('-r', path.join(ROOT, 'node_modules'), destScriptsDir);

let nodeModulesDir = path.join(ROOT, 'node_modules');
if (fs.existsSync(nodeModulesDir)) shell.cp('-r', nodeModulesDir, destScriptsDir);

// Copy the check_reqs script
shell.cp(path.join(binDir, 'check_reqs*'), destScriptsDir);
Expand Down

0 comments on commit dacf624

Please sign in to comment.