You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2014/01/07 19:21:56 UTC

webworks commit: CB-5736 Support host names for target command

Updated Branches:
  refs/heads/master 37e9fc11c -> 9ae84e6fb


CB-5736 Support host names for target command


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

Branch: refs/heads/master
Commit: 9ae84e6fbbc94dce1ae2ca9d46c1e032731bf002
Parents: 37e9fc1
Author: Bryan Higgins <bh...@blackberry.com>
Authored: Tue Jan 7 13:24:00 2014 -0500
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Tue Jan 7 13:24:00 2014 -0500

----------------------------------------------------------------------
 blackberry10/bin/lib/target.js | 31 +------------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/9ae84e6f/blackberry10/bin/lib/target.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/lib/target.js b/blackberry10/bin/lib/target.js
index 206e8c0..eaabf91 100644
--- a/blackberry10/bin/lib/target.js
+++ b/blackberry10/bin/lib/target.js
@@ -31,30 +31,6 @@ var path = require('path'),
     pin,
     pinRegex = new RegExp("[0-9A-Fa-f]{8}");
 
-function isValidIp(ip) {
-    var num,
-        result = true,
-        ipArray;
-
-    if (typeof ip !== 'string') {
-        console.log("IP is required");
-        console.log(commander.helpInformation());
-        exit(ERROR_VALUE);
-    } else {
-        ipArray = ip.split('.');
-        if (ipArray.length !== 4) {
-            result = false;
-        }
-        ipArray.forEach(function (quadrant) {
-            num = Number(quadrant);
-            if (isNaN(num) || (num < 0) || (num > 255)) {
-                result = false;
-            }
-        });
-    }
-    return result;
-}
-
 function isValidType(type) {
     var result = true;
 
@@ -87,7 +63,7 @@ commander
     .on('--help', function () {
         console.log('   Synopsis:');
         console.log('   $ target');
-        console.log('   $ target add <name> <ip> [-t | --type <device | simulator>] [-p | --password <password>] [--pin <devicepin>]');
+        console.log('   $ target add <name> <host> [-t | --type <device | simulator>] [-p | --password <password>] [--pin <devicepin>]');
         console.log('   $ target remove <name>');
         console.log(' ');
     });
@@ -110,11 +86,6 @@ commander
         if (commander.pin && typeof commander.pin === 'string') {
             pin = commander.pin;
         }
-        if (!isValidIp(ip)) {
-            console.log("Invalid IP: " + ip);
-            console.log(commander.helpInformation());
-            exit(ERROR_VALUE);
-        }
         if (!isValidType(type)) {
             console.log("Invalid target type: " + type);
             console.log(commander.helpInformation());