Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Only copy platform node_modules when created by binary #68

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/create
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ if (argv.argv.remain[2]) config.setName(argv.argv.remain[2]);

var options = {
link: argv.link,
customTemplate: argv.argv.remain[3]
customTemplate: argv.argv.remain[3],
copyPlatformNodeModules: true
};

Api.createPlatform(projectPath, config, options).done();
6 changes: 3 additions & 3 deletions bin/lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function copyJsAndCordovaLib (projectPath, projectName, use_shared) {
});
}

function copyScripts (projectPath) {
function copyScripts (projectPath, options) {
var srcScriptsDir = path.join(ROOT, 'bin', 'templates', 'scripts', 'cordova');
var destScriptsDir = path.join(projectPath, 'cordova');

Expand All @@ -83,7 +83,7 @@ function copyScripts (projectPath) {
// Copy in the new ones.
var binDir = path.join(ROOT, 'bin');
shell.cp('-r', srcScriptsDir, projectPath);
shell.cp('-r', path.join(ROOT, 'node_modules'), destScriptsDir);
if (options.copyPlatformNodeModules) shell.cp('-r', path.join(ROOT, 'node_modules'), destScriptsDir);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (options.copyPlatformNodeModules) shell.cp('-r', path.join(ROOT, 'node_modules'), destScriptsDir);
if (options.copyPlatformNodeModules)
shell.cp('-r', path.join(ROOT, 'node_modules'), destScriptsDir);

(minor suggestion)


// Copy the check_reqs script
shell.cp(path.join(binDir, 'check_reqs*'), destScriptsDir);
Expand Down Expand Up @@ -188,7 +188,7 @@ exports.createProject = function (project_path, package_name, project_name, opts

// CordovaLib stuff
copyJsAndCordovaLib(project_path, project_name, use_shared);
copyScripts(project_path);
copyScripts(project_path, opts);

events.emit('log', generateDoneMessage('create', use_shared));
return Q.resolve();
Expand Down