Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only copy platform node_modules when created by binary #456

Merged
merged 1 commit into from
Nov 7, 2018
Merged
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
1 change: 1 addition & 0 deletions bin/create
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var options = {
cli: argv.cli,
link: argv.link || argv.shared,
customTemplate: argv.argv.remain[3],
copyPlatformNodeModules: true
};

require('./templates/scripts/cordova/loggingHelper').adjustLoggerLevel(argv);
Expand Down
6 changes: 3 additions & 3 deletions bin/lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function copyJsAndCordovaLib (projectPath, projectName, use_shared) {
});
}

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

Expand All @@ -76,7 +76,7 @@ function copyScripts (projectPath, projectName) {
// 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 the check_reqs script
shell.cp(path.join(binDir, 'check_reqs*'), destScriptsDir);
Expand Down Expand Up @@ -232,7 +232,7 @@ exports.createProject = function (project_path, package_name, project_name, opts

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

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