You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/12/03 10:52:22 UTC

[GitHub] erisu closed pull request #68: Only copy platform node_modules when created by binary

erisu closed pull request #68: Only copy platform node_modules when created by binary
URL: https://github.com/apache/cordova-osx/pull/68
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bin/create b/bin/create
index 94319994..7b47f8b4 100755
--- a/bin/create
+++ b/bin/create
@@ -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();
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 06aa0df6..0d56d574 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -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');
 
@@ -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 the check_reqs script
     shell.cp(path.join(binDir, 'check_reqs*'), destScriptsDir);
@@ -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();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org