You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2018/12/19 01:44:22 UTC
[cordova-windows] branch master updated: Copy node_modules if the
directory exists (#317)
This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git
The following commit(s) were added to refs/heads/master by this push:
new e360d30 Copy node_modules if the directory exists (#317)
e360d30 is described below
commit e360d306c1d8c886dbab6285b9727cbf9625df87
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Wed Dec 19 10:44:17 2018 +0900
Copy node_modules if the directory exists (#317)
---
bin/lib/create.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 975fc35..0417e0e 100644
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -73,8 +73,11 @@ module.exports.create = function (destinationDir, config, options) {
shell.cp('-rf', path.join(root, 'VERSION'), projectPath);
// copy node_modules to cordova directory
- events.emit('verbose', 'Copying node_modules to ' + projectPath);
- shell.cp('-r', path.join(root, 'node_modules'), path.join(projectPath, 'cordova'));
+ let nodeModulesDir = path.join(root, 'node_modules');
+ if (fs.existsSync(nodeModulesDir)) {
+ events.emit('verbose', 'Copying node_modules to ' + projectPath);
+ shell.cp('-r', nodeModulesDir, path.join(projectPath, 'cordova'));
+ }
// copy check_reqs module to cordova directory
shell.cp('-rf', path.join(root, 'bin', 'check_reqs*'), path.join(projectPath, 'cordova'));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org