You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2016/06/04 00:15:07 UTC

cordova-lib git commit: CB-11252 minor fix to trimID function in cordova-fetch

Repository: cordova-lib
Updated Branches:
  refs/heads/master 7e9f45387 -> 4b30b73b0


CB-11252 minor fix to trimID function in cordova-fetch


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

Branch: refs/heads/master
Commit: 4b30b73b05a955956ee38b398f385e9744a08188
Parents: 7e9f453
Author: Steve Gill <st...@gmail.com>
Authored: Fri Jun 3 17:14:38 2016 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Fri Jun 3 17:14:38 2016 -0700

----------------------------------------------------------------------
 cordova-fetch/index.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4b30b73b/cordova-fetch/index.js
----------------------------------------------------------------------
diff --git a/cordova-fetch/index.js b/cordova-fetch/index.js
index b5a9b66..99b622b 100644
--- a/cordova-fetch/index.js
+++ b/cordova-fetch/index.js
@@ -149,9 +149,11 @@ function trimID(target) {
     }
     
     //strip away everything after '@'
+    //also support scoped packages
     if(target.indexOf('@') != -1) {
         parts = target.split('@');
-        if (parts.length > 2) {
+        if (parts.length > 1) {
+            //scoped package
             target = '@' + parts[1];
         } else {
             target = parts[0];
@@ -180,7 +182,6 @@ function getPath(id, dest) {
     } else return Q.reject(new CordovaError('Failed to get absolute path to installed module'));
 }
 
-
 /*
  * Checks to see if npm is installed on the users system
  * @return {Promise|Error} Returns true or a cordova error.


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