You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2015/07/22 20:37:40 UTC
[2/4] android commit: CB-9397 Fixes minor issues with `cordova
requirements android`
CB-9397 Fixes minor issues with `cordova requirements android`
(cherry picked from commit d99a21eb8debecb9e247c60365a28632a365efb6)
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/5fb913d0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/5fb913d0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/5fb913d0
Branch: refs/heads/4.1.x
Commit: 5fb913d00088a9df8ea0816c523a6558d271dd25
Parents: 5fa4728
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Wed Jul 22 16:45:49 2015 +0300
Committer: Nikhil Khandelwal <ni...@microsoft.com>
Committed: Wed Jul 22 11:33:29 2015 -0700
----------------------------------------------------------------------
bin/lib/check_reqs.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/5fb913d0/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 0b31a2a..ffa35b6 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -82,9 +82,13 @@ module.exports.check_ant = function() {
// Returns a promise. Called only by build and clean commands.
module.exports.check_gradle = function() {
var sdkDir = process.env['ANDROID_HOME'];
+ if (!sdkDir)
+ return Q.reject('Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.\n' +
+ 'Might need to install Android SDK or set up \'ANDROID_HOME\' env variable.');
+
var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper');
if (!fs.existsSync(wrapperDir)) {
- return Q.reject(new Error('Could not find gradle wrapper within android sdk. Might need to update your Android SDK.\n' +
+ return Q.reject(new Error('Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.\n' +
'Looked here: ' + wrapperDir));
}
return Q.when();
@@ -312,7 +316,7 @@ module.exports.check_all = function() {
requirement.installed = true;
requirement.metadata.version = version;
}, function (err) {
- requirement.metadata.reason = err;
+ requirement.metadata.reason = err instanceof Error ? err.message : err;
});
}, Q())
.then(function () {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org