You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2016/08/11 11:48:12 UTC
android commit: CB-11683 Fixed linking to directories during plugin
installation.
Repository: cordova-android
Updated Branches:
refs/heads/master d54a42f0f -> db6295c91
CB-11683 Fixed linking to directories during plugin installation.
This closes #322
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/db6295c9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/db6295c9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/db6295c9
Branch: refs/heads/master
Commit: db6295c917ceb76a0751d08ac67da3cee04730fb
Parents: d54a42f
Author: Szymon Drosdzol <sd...@insert.com.pl>
Authored: Tue Aug 9 09:18:37 2016 +0200
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu Aug 11 14:47:36 2016 +0300
----------------------------------------------------------------------
bin/templates/cordova/lib/pluginHandlers.js | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/db6295c9/bin/templates/cordova/lib/pluginHandlers.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/pluginHandlers.js b/bin/templates/cordova/lib/pluginHandlers.js
index 24cda4d..8008dcb 100644
--- a/bin/templates/cordova/lib/pluginHandlers.js
+++ b/bin/templates/cordova/lib/pluginHandlers.js
@@ -214,10 +214,17 @@ function copyFile (plugin_dir, src, project_dir, dest, link) {
throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project');
shell.mkdir('-p', path.dirname(dest));
-
+ var srcStat = fs.statSync(src);
if (link) {
- fs.symlinkSync(path.relative(path.dirname(dest), src), dest);
- } else if (fs.statSync(src).isDirectory()) {
+ //CB-11683 We need to handle linking to directories on our own because Windows doesn't.
+ var type;
+ if (srcStat.isDirectory()) {
+ type = 'dir';
+ } else {
+ type = 'file';
+ }
+ fs.symlinkSync(path.relative(path.dirname(dest), src), dest, type);
+ } else if (srcStat.isDirectory()) {
// XXX shelljs decides to create a directory when -R|-r is used which sucks. http://goo.gl/nbsjq
shell.cp('-Rf', src+'/*', dest);
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org