Everywhere that we call a raw function, add a new line

This commit is contained in:
ekatek
2014-12-06 17:38:41 -08:00
parent dd96477c51
commit 25dfd39ef1
7 changed files with 35 additions and 31 deletions

View File

@@ -184,7 +184,7 @@ var setVerboseness = cordova.setVerboseness = function (v) {
};
var verboseLog = cordova.verboseLog = function (/* args */) {
if (verboseness)
Console.rawError('%% ' + util.format.apply(null, arguments));
Console.rawError('%% ' + util.format.apply(null, arguments) + "\n");
};
@@ -374,8 +374,8 @@ var ensureCordovaProject = function (projectContext, appName) {
if (err instanceof main.ExitWithCode) {
process.exit(err.code);
}
Console.rawError("Error creating Cordova project: " +
err.message + "\n" + err.stack);
Console.error("Error creating Cordova prject: " + err.message);
Console.rawError(err.stack + "\n");
}
}
};
@@ -2075,8 +2075,8 @@ _.extend(Android.prototype, {
if (execution.exitCode !== 0) {
Console.warn(
"Unexpected exit code from android process: " + execution.exitCode);
Console.rawWarn("stdout: " + execution.stdout);
Console.rawWarn("stderr: " + execution.stderr);
Console.rawWarn("stdout: " + execution.stdout + "\n");
Console.rawWarn("stderr: " + execution.stderr + "\n");
throw new Error("Error running android tool: exit code " + execution.exitCode);
}
@@ -2195,9 +2195,9 @@ _.extend(Android.prototype, {
if (execution.exitCode !== 0) {
Console.debug("Unable to run aapt." +
" (This is normal if 32 bit libraries are not found)");
Console.rawDebug(" exit code: " + execution.exitCode);
Console.rawDebug(" stdout: " + execution.stdout);
Console.rawDebug(" stderr: " + execution.stderr);
Console.rawDebug(" exit code: " + execution.exitCode + "\n");
Console.rawDebug(" stdout: " + execution.stdout + "\n");
Console.rawDebug(" stderr: " + execution.stderr + "\n");
return false;
}
@@ -2396,7 +2396,9 @@ _.extend(Android.prototype, {
if (Host.hasAptGet()) {
Console.info("You can install the JDK using:");
Console.rawInfo(" sudo apt-get install --yes openjdk-7-jdk");
Console.info(
Console.comand("sudo apt-get install --yes openjdk-7-jdk"),
Console.options({ indent: 2 }));
// XXX: Technically, these are for Android, not installing Java
if (processor == "x86_64") {
@@ -2496,8 +2498,8 @@ _.extend(Android.prototype, {
if (execution.exitCode != 0) {
Console.warn(
"Unexpected exit code from script: " + execution.exitCode);
Console.rawWarn("stdout: " + execution.stdout);
Console.rawWarn("stderr: " + execution.stderr);
Console.rawWarn("stdout: " + execution.stdout + "\n");
Console.rawWarn("stderr: " + execution.stderr + "\n");
throw new Error('Could not download Android bundle');
}
});
@@ -2592,7 +2594,7 @@ _.extend(Android.prototype, {
device[kv[0]] = kv[1];
}
devices.push(device);
Console.rawDebug("Found device", JSON.stringify(device));
Console.rawDebug("Found device", JSON.stringify(device) + "\n");
});
return devices;
},
@@ -2977,7 +2979,7 @@ main.registerCommand({
var platforms = projectContext.platformList.getPlatforms();
Console.rawInfo(platforms.join("\n"));
Console.rawInfo(platforms.join("\n") + "\n");
});
main.registerCommand({

View File

@@ -1174,7 +1174,8 @@ main.registerCommand({
var myMaintainerString = "";
var myMaintainers = _.pluck(record.maintainers, 'username');
if (myMaintainers.length === 0) {
Console.rawDebug("No maintainer records found: ", JSON.stringify(record));
Console.rawDebug(
"No maintainer records found: ", JSON.stringify(record), "\n");
} else if (myMaintainers.length === 1) {
myMaintainerString = myMaintainers[0];
} else {

View File

@@ -198,7 +198,7 @@ function doRunCommand (options) {
} catch (err) {
if (options.verbose) {
Console.rawError(
"Error while parsing --port option: " + err.stack);
"Error while parsing --port option: " + err.stack + "\n");
} else {
Console.error(err.message);
}
@@ -215,7 +215,7 @@ function doRunCommand (options) {
} catch (err) {
if (options.verbose) {
Console.rawError(
"Error while parsing --mobile-server option: " + err.stack);
"Error while parsing --mobile-server option: " + err.stack + "\n");
} else {
Console.error(err.message);
}
@@ -1676,7 +1676,7 @@ main.registerCommand({
if (body.organizations.length === 0) {
Console.info("You are not a member of any organizations.");
} else {
Console.rawInfo(_.pluck(body.organizations, "name").join("\n"));
Console.rawInfo(_.pluck(body.organizations, "name").join("\n") + "\n");
}
return 0;
});
@@ -1732,7 +1732,7 @@ main.registerCommand({
}
var members = _.pluck(result, "username");
Console.rawInfo(members.join("\n"));
Console.rawInfo(members.join("\n") + "\n");
}
return 0;
@@ -1925,7 +1925,7 @@ main.registerCommand({
'key' : ret.sshKey,
'hostKey' : ret.hostKey
};
Console.rawInfo(JSON.stringify(retJson, null, 2));
Console.rawInfo(JSON.stringify(retJson, null, 2) + "\n");
return 0;
}

View File

@@ -758,9 +758,9 @@ _.extend(Console.prototype, {
self._print(LEVEL_ERROR, message);
},
_prettifyMessage: function (/* arguments */) {
_prettifyMessage: function (msgArguments) {
var self = this;
var parsedArgs = self._parseVariadicInput(arguments);
var parsedArgs = self._parseVariadicInput(msgArguments);
var wrapOpts = {
indent: parsedArgs.opts.indent,
bulletPoint: parsedArgs.opts.bulletPoint
@@ -909,7 +909,7 @@ _.extend(Console.prototype, {
self.error(message);
if (self.verbose && err.stack) {
self.rawInfo(err.stack);
self.rawInfo(err.stack + "\n");
}
},

View File

@@ -1058,7 +1058,7 @@ Fiber(function () {
if (showHelp) {
// XXX: Until we rewrite the longHelp function to cope with the new output
// format, let's go with the static, painstakingly-formatted version.
Console.rawInfo(longHelp(commandName));
Console.rawInfo(longHelp(commandName) + "\n");
process.exit(0);
}
@@ -1293,7 +1293,7 @@ Fiber(function () {
throw new Error(
"you meant 'throw new main.Foo', not 'throw main.Foo'");
} else if (e instanceof main.ShowUsage) {
Console.rawError(longHelp(commandName));
Console.rawError(longHelp(commandName) + "\n");
process.exit(1);
} else if (e instanceof main.SpringboardToLatestRelease) {
// Load the metadata for the latest release (or at least, the latest

View File

@@ -1706,7 +1706,7 @@ var runTests = function (options) {
var relpath = path.relative(files.getCurrentToolsDir(),
frames[0].file);
Console.rawError(" => " + failure.reason + " at " +
relpath + ":" + frames[0].line);
relpath + ":" + frames[0].line + "\n");
if (failure.reason === 'no-match') {
Console.arrowError("Pattern: " + failure.details.pattern, 2);
}
@@ -1716,14 +1716,14 @@ var runTests = function (options) {
};
Console.rawError(" => " + "Expected: " + s(failure.details.expected) +
"; actual: " + s(failure.details.actual));
"; actual: " + s(failure.details.actual) + "\n");
}
if (failure.reason === 'expected-exception') {
}
if (failure.reason === 'not-equal') {
Console.rawError(
" => " + "Expected: " + JSON.stringify(failure.details.expected) +
"; actual: " + JSON.stringify(failure.details.actual));
"; actual: " + JSON.stringify(failure.details.actual) + "\n");
}
if (failure.details.run) {
@@ -1740,14 +1740,14 @@ var runTests = function (options) {
Console.rawError(" " +
(line.channel === "stderr" ? "2| " : "1| ") +
line.text +
(line.bare ? "%" : ""));
(line.bare ? "%" : "") + "\n");
});
}
}
if (failure.details.messages) {
Console.arrowError("Errors while building:", 2);
Console.rawError(failure.details.messages.formatMessages());
Console.rawError(failure.details.messages.formatMessages() + "\n");
}
} else {
var durationMs = +(new Date) - startTime;
@@ -1776,7 +1776,7 @@ var runTests = function (options) {
Console.error(failureCount + " failure" +
(failureCount > 1 ? "s" : "") + ":");
_.each(failedTests, function (test) {
Console.rawError(" - " + test.file + ": " + test.name);
Console.rawError(" - " + test.file + ": " + test.name + "\n");
});
return 1;
}

View File

@@ -122,7 +122,8 @@ var logErrorIfInCheckout = function (err) {
Console.warn(
"(This error is hidden when you are not running Meteor from a",
"checkout.)");
Console.rawWarn(err.stack || err);
var printErr = err.stack || err;
Console.rawWarn(printErr + "\n");
Console.warn();
Console.warn();
}