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 2019/03/07 06:32:27 UTC

[cordova-lib] branch master updated: CB-14166: (cli) Fixed issue when install plugins on windows (#622)

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-lib.git


The following commit(s) were added to refs/heads/master by this push:
     new d4df8a9  CB-14166: (cli) Fixed issue when install plugins on windows (#622)
d4df8a9 is described below

commit d4df8a9390f92fa28ba7307f8ca5bbb2f9041b82
Author: Almir Kadric <gi...@almirkadric.com>
AuthorDate: Thu Mar 7 15:32:22 2019 +0900

    CB-14166: (cli) Fixed issue when install plugins on windows (#622)
    
    The npm package name is already wrapped in quotes to prevent special characters from being execute. However the additional win32 code was further injecting quotes around the version causing npm to return a EINVALIDTAGNAME error. The win32 code is redundant and seems to not be required.
---
 src/plugman/fetch.js | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/plugman/fetch.js b/src/plugman/fetch.js
index b5994f9..74b8e76 100644
--- a/src/plugman/fetch.js
+++ b/src/plugman/fetch.js
@@ -119,7 +119,6 @@ function fetchPlugin (plugin_src, plugins_dir, options) {
             var parsedSpec = pluginSpec.parse(plugin_src);
             var P;
             var skipCopyingPlugin;
-            var specContainsSpecialCharacters = false;
             plugin_dir = path.join(plugins_dir, parsedSpec.id);
             // if the plugin has already been fetched, use it.
             if (fs.existsSync(plugin_dir)) {
@@ -134,16 +133,7 @@ function fetchPlugin (plugin_src, plugins_dir, options) {
                     projectRoot = options.projectRoot;
                 }
 
-                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);
+                P = fetch(plugin_src, projectRoot, options);
                 skipCopyingPlugin = false;
             }
             return P


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