Merge branch 'android_tweaks' into release-0.9.2

This commit is contained in:
Slava Kim
2014-09-10 16:51:47 -07:00
2 changed files with 19 additions and 6 deletions

View File

@@ -93,8 +93,17 @@ var execFileSyncOrThrow = function (file, args, opts) {
opts.env || {});
var childProcess = execFileSync(file, args, opts);
if (! childProcess.success)
throw new Error('Failed to run ' + file + '\n' + childProcess.stderr + '\n\n' + childProcess.stdout);
if (! childProcess.success) {
// XXX: Include args
var message = 'Error running ' + file;
if (childProcess.stderr) {
message = message + "\n" + childProcess.stderr + "\n";
}
if (childProcess.stdout) {
message = message + "\n" + childProcess.stdout + "\n";
}
throw new Error(message);
}
return childProcess;
};
@@ -114,8 +123,9 @@ var ensureAndroidBundle = function (command) {
try {
execFileSyncOrThrow('bash', [ensureScriptPath], { pipeOutput: true });
} catch (err) {
verboseLog('Failed to install android_bundle: ', err.stack);
throw new Error('Failed to install android_bundle: ' + err.message);
verboseLog('Failed to install android_bundle ', err.stack);
process.stderr.write("Failed to install android_bundle\n");
throw new main.ExitWithCode(2);
}
};
@@ -272,6 +282,9 @@ cordova.ensureCordovaProject = function (localPath, appName) {
// XXX cache them there
files.mkdir_p(localPluginsPath);
} catch (err) {
if (err instanceof main.ExitWithCode) {
process.exit(err.code);
}
process.stderr.write("Error creating Cordova project: " +
err.message + "\n" + err.stack + "\n");
}

View File

@@ -17,10 +17,10 @@ source $(dirname $0)/common_env.sh
command -v java >/dev/null 2>&1 || {
if [ ${UNAME} == "Linux" ] ; then
echo "Please install Java before running this command.";
echo "Please install a Java JDK before running this command.";
echo "Directions can be found at: http://openjdk.java.net/install/"
else
echo "The android platform needs Java to be installed on your system."
echo "The android platform needs a Java JDK to be installed on your system."
java -version
fi