From issues-return-97344-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Tue Sep 18 03:39:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CCBFB180679 for ; Tue, 18 Sep 2018 03:39:04 +0200 (CEST) Received: (qmail 4434 invoked by uid 500); 18 Sep 2018 01:39:03 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 4413 invoked by uid 99); 18 Sep 2018 01:39:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2018 01:39:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 44D41C784A for ; Tue, 18 Sep 2018 01:39:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.5 X-Spam-Level: X-Spam-Status: No, score=-109.5 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100, WEIRD_QUOTING=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id gRM4o6PVyqTD for ; Tue, 18 Sep 2018 01:39:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 55D1E5F572 for ; Tue, 18 Sep 2018 01:39:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 61626E2634 for ; Tue, 18 Sep 2018 01:39:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 83B4223FA8 for ; Tue, 18 Sep 2018 01:39:00 +0000 (UTC) Date: Tue, 18 Sep 2018 01:39:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-14166) Cordova on windows fails when adding plugin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-14166?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D166183= 65#comment-16618365 ]=20 ASF GitHub Bot commented on CB-14166: ------------------------------------- brodybits closed pull request #688: CB-14166 distinguish npm.cmd and npm.ex= e in win32, to check if escape is necessary (workaround solution) URL: https://github.com/apache/cordova-lib/pull/688 =20 =20 =20 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/package.json b/package.json index 277b0c7a0..47290081e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "read-chunk": "^3.0.0", "semver": "^5.3.0", "shebang-command": "^1.2.0", - "underscore": "^1.9.0" + "underscore": "^1.9.0", + "which": "^1.3.1" }, "devDependencies": { "codecov": "^3.0.1", diff --git a/src/plugman/fetch.js b/src/plugman/fetch.js index d52bae7aa..dd1e28d8c 100644 --- a/src/plugman/fetch.js +++ b/src/plugman/fetch.js @@ -18,6 +18,7 @@ */ =20 var fs =3D require('fs-extra'); +var which =3D require('which'); var url =3D require('url'); var underscore =3D require('underscore'); var semver =3D require('semver'); @@ -136,10 +137,13 @@ function fetchPlugin (plugin_src, plugins_dir, option= s) { } =20 if (process.platform =3D=3D=3D 'win32' && parsedSpec.versi= on) { - var windowsShellSpecialCharacters =3D ['&', '\\', '<',= '>', '^', '|']; - specContainsSpecialCharacters =3D windowsShellSpecialC= haracters.some(function (character) { - return parsedSpec.version.indexOf(character); - }); + var npmExtension =3D path.extname(which.sync('npm')); + if (npmExtension && npmExtension.toUpperCase() !=3D=3D= '.EXE') { + var windowsShellSpecialCharacters =3D ['&', '\\', = '<', '>', '^', '|']; + specContainsSpecialCharacters =3D windowsShellSpec= ialCharacters.some(function (character) { + return parsedSpec.version.indexOf(character) >= =3D 0; + }); + } } =20 var fetchPluginSrc =3D specContainsSpecialCharacters ? =20 ---------------------------------------------------------------- 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. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > Cordova on windows fails when adding plugin > ------------------------------------------- > > Key: CB-14166 > URL: https://issues.apache.org/jira/browse/CB-14166 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-windows > Reporter: takuya > Assignee: Jesse MacFadyen > Priority: Blocker > Attachments: screenshot-1.png, =E3=82=B9=E3=82=AF=E3=83=AA=E3=83= =BC=E3=83=B3=E3=82=B7=E3=83=A7=E3=83=83=E3=83=88 2018-09-06 11.36.42.png > > > cordova on windows fails to add the plugin. > This error happens even when cordova-plugin-whitelist. > Therefore `cordova platform add windows` also fails. > For example, > ``` > > cordova create sample > > cd sample > > cordova platform add windows > ``` > brings following error. > ``` > ... > Check your connection and plugin name/version/URL. > Error: C:\Program Files (x86)\Nodist\bin\npm.exe: Command failed with exi= t code 1 Error output: > npm ERR! code EINVALIDTAGNAME > npm ERR! Invalid tag name ""1"": Tags may not have any characters that en= codeURIComponent encodes. > ``` > This error happens for windows environment only. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org