Skip to content

Commit

Permalink
fix Transport#prompt() to handle --no-color (fixes #70)
Browse files Browse the repository at this point in the history
  • Loading branch information
pstadler committed Feb 4, 2015
1 parent bc5e811 commit d4bfae7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ var format = require('util').format
, logger = require('./logger')()
, errors = require('./errors')
, flight = require('./flight')
, prettyTime = require('pretty-hrtime');
, prettyTime = require('pretty-hrtime')
, chalk = require('chalk');

var DEFAULT_TASK = 'default';

Expand Down Expand Up @@ -312,7 +313,7 @@ Flightplan.prototype.run = function(task, target, options) {
options = options || {};

if(options.color !== undefined) {
logger.useColors(options.color);
chalk.enabled = options.color;
}

if(Object.keys(this._targets).indexOf(target) === -1) {
Expand Down
4 changes: 0 additions & 4 deletions lib/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ function Logger(options) {
}
}

Logger.prototype.useColors = function(flag) {
chalk.enabled = flag;
};

Logger.prototype.user = function(message) {
this._log(chalk.cyan(message));
};
Expand Down
1 change: 1 addition & 0 deletions lib/transport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ Transport.prototype.prompt = (function() {

return this.waitFor(function(done) {
Queue.push(function() {
prompt.colors = false;
prompt.delimiter = '';
prompt.message = chalk.gray(self._context.remote.host);
prompt.start();
Expand Down

0 comments on commit d4bfae7

Please sign in to comment.