rename Console.directory to Console.path, do not escape spaces

Rename Console.directory to Console.path.

Do not attempt to automatically escape spaces in file paths -- it is
hard to define a function that does this only sometimes, rather than all
the time. This is something that we could change later, once we have a better
idea of when we use it.
This commit is contained in:
ekatek
2014-12-08 18:37:49 -08:00
parent 8d213d0cb0
commit 07ff83f2c9
2 changed files with 5 additions and 7 deletions

View File

@@ -1899,7 +1899,7 @@ _.extend(IOS.prototype, {
"Moreover, some Cordova plugins are incompatible with this SDK.",
"You can remove it by deleting this directory: ");
Console.warn(
Console.directory(self.getDirectoryForSdk(version)),
Console.path(self.getDirectoryForSdk(version)),
Console.options({ indent: 4 }));
// Not really a failure; just warn...
}

View File

@@ -939,13 +939,11 @@ _.extend(Console.prototype, {
return self.underline(unspaced);
},
directory: function (message) {
// Format a filepath to not wrap. This does NOT automatically escape spaces
// (ie: add a slash in front so the user could copy paste the file path into a
// terminal).
path: function (message) {
var self = this;
// Escape any spaces that we don't already escape.
var escapedSpace = "\\ ";
message = _.map(message.split(escapedSpace), function (msg) {
return replaceAll(msg, ' ', escapedSpace);
}).join(escapedSpace);
// Make sure that we don't wrap this.
var unwrapped = self.noWrap(message);
return self.bold(unwrapped);