cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cordova-lib git commit: CB-12738: Cordova ignores plugin dependency version on windows platform
Date Fri, 02 Jun 2017 20:39:22 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master d244cf844 -> a7b5433f4


CB-12738: Cordova ignores plugin dependency version on windows platform

 This closes #554


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/a7b5433f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/a7b5433f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/a7b5433f

Branch: refs/heads/master
Commit: a7b5433f47f09546a8024948d0d8935281e944de
Parents: d244cf8
Author: Nikita Matrosov <v-nimatr@microsoft.com>
Authored: Thu May 11 22:43:49 2017 +0300
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Fri Jun 2 13:39:40 2017 -0700

----------------------------------------------------------------------
 cordova-fetch/spec/fetch.spec.js |  2 +-
 cordova-lib/src/plugman/fetch.js | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a7b5433f/cordova-fetch/spec/fetch.spec.js
----------------------------------------------------------------------
diff --git a/cordova-fetch/spec/fetch.spec.js b/cordova-fetch/spec/fetch.spec.js
index 6f41c9c..49085fc 100644
--- a/cordova-fetch/spec/fetch.spec.js
+++ b/cordova-fetch/spec/fetch.spec.js
@@ -146,7 +146,7 @@ describe('platform fetch/uninstall test via npm & git tags with --save',
functio
             expect(err).toBeUndefined();
         })
         .fin(done);
-    }, 100000);
+    }, 150000);
 });
 
 describe('plugin fetch/uninstall test with --save', function () {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a7b5433f/cordova-lib/src/plugman/fetch.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js
index d06502f..75024fd 100644
--- a/cordova-lib/src/plugman/fetch.js
+++ b/cordova-lib/src/plugman/fetch.js
@@ -175,7 +175,7 @@ function fetchPlugin(plugin_src, plugins_dir, options) {
             }
             // If not found in local search path, fetch from the registry.
             var parsedSpec = pluginSpec.parse(plugin_src);
-            var P, skipCopyingPlugin;
+            var P, skipCopyingPlugin, specContainsSpecialCharacters = false;
             plugin_dir = path.join(plugins_dir, parsedSpec.id);
             // if the plugin has already been fetched, use it.
             if (fs.existsSync(plugin_dir)) {
@@ -190,7 +190,17 @@ function fetchPlugin(plugin_src, plugins_dir, options) {
                     if(options.projectRoot) {
                         projectRoot = options.projectRoot;
                     }
-                    P = fetch(plugin_src, projectRoot, options); 
+
+                    if (process.platform === 'win32' && parsedSpec.version) {
+                        var windowsShellSpecialCharacters = ['&', '\\', '<', '>',
'^', '|'];
+                        specContainsSpecialCharacters = windowsShellSpecialCharacters.some(function
(character) {
+                            return parsedSpec.version.indexOf(character);
+                        });
+                    }
+
+                    var fetchPluginSrc = specContainsSpecialCharacters ?
+                        parsedSpec.package + '@"' + parsedSpec.version + '"' : plugin_src;
+                    P = fetch(fetchPluginSrc, projectRoot, options);
                 } else {
                     P = registry.fetch([plugin_src]);
                 }


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


Mime
View raw message