You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by na...@apache.org on 2014/10/02 20:17:56 UTC

[22/29] git commit: CB-7536 check_reqs: windows tweaks + sdk manager error message

CB-7536 check_reqs: windows tweaks + sdk manager error message

1. Don't escape \s since those are used by windows for directory seperators
2. Don't warn about missing directories on windows when we're just
testing for their existence
3. Don't give command to install sdk from command-line, since they also
require Build-tools and Platform-tools (which are not installed by
default with IDE-less SDK installer).


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/6dc24077
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/6dc24077
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/6dc24077

Branch: refs/heads/master
Commit: 6dc2407795460180f9e31d1468a7469ab5fa575c
Parents: 0c5c9a3
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Sep 16 10:28:34 2014 -0400
Committer: Prabhjot Singh <pr...@amazon.com>
Committed: Wed Sep 17 21:23:22 2014 +0530

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/6dc24077/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index c9ab6ad..d2f99af 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -110,10 +110,13 @@ module.exports.check_java = function() {
                 }
             } else if (isWindows) {
                 // Try to auto-detect java in the default install paths.
+                var oldSilent = shelljs.config.silent;
+                shelljs.config.silent = true;
                 var firstJdkDir =
                     shelljs.ls(process.env['ProgramFiles'] + '\\java\\jdk*')[0] ||
                     shelljs.ls('C:\\Program Files\\java\\jdk*')[0] ||
                     shelljs.ls('C:\\Program Files (x86)\\java\\jdk*')[0];
+                shelljs.config.silent = oldSilent;
                 if (firstJdkDir) {
                     // shelljs always uses / in paths.
                     firstJdkDir = firstJdkDir.replace(/\//g, path.sep);
@@ -195,7 +198,7 @@ module.exports.check_android = function() {
 };
 
 module.exports.getAbsoluteAndroidCmd = function() {
-    return forgivingWhichSync('android').replace(/([ \\])/g, '\\$1');
+    return forgivingWhichSync('android').replace(/(\s)/g, '\\$1');
 };
 
 module.exports.check_android_target = function(valid_target) {
@@ -209,9 +212,12 @@ module.exports.check_android_target = function(valid_target) {
     .then(function(output) {
         if (output.split('\n').indexOf(valid_target) == -1) {
             var androidCmd = module.exports.getAbsoluteAndroidCmd();
-            throw new Error('Please install Android target: "' + valid_target + '".\n' +
+            throw new Error('Please install Android target: "' + valid_target + '".\n\n' +
                 'Hint: Open the SDK manager by running: ' + androidCmd + '\n' +
-                'Or install directly via: ' + androidCmd + ' update sdk --no-ui --all --filter "' + valid_target + '"');
+                'You will require:\n' +
+                '1. "SDK Platform" for ' + valid_target + '\n' +
+                '2. "Android SDK Platform-tools (latest)\n' +
+                '3. "Android SDK Build-tools" (latest)');
         }
     });
 };


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