Permalink
Browse files

keys: refactor messages.

  • Loading branch information...
1 parent a033196 commit bea8585e57c35ebfa5014cab812f2f8a4dae68ef @chjj chjj committed Apr 10, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 lib/jitsu/commands/keys.js
View
@@ -22,19 +22,21 @@ keys.create = function (keyName, file, callback) {
var data = { name: keyName };
function checkType() {
- jitsu.log.info('Type of key? (api/ssh)');
+ jitsu.log.info('Type of key? ' + '(api/ssh)'.magenta);
jitsu.prompt.get(['type'], function (err, result) {
if (result.type === 'ssh') {
jitsu.log.info('Please enter location of public key.');
- jitsu.log.info('~/.ssh/id_rsa.pub will be used by default.');
+ jitsu.log.info(
+ '~/.ssh/id_rsa.pub'.magenta
+ + ' will be used by default.');
return jitsu.prompt.get(['file'], function (err, result) {
if (err) return callback(err);
file = result.file || jitsu.config.get('root') + '/.ssh/id_rsa.pub';
return checkTTL(readKey);
});
}
return checkTTL(function() {
- jitsu.log.info('Generating API key...');
+ jitsu.log.info('Generating API key.');
return createKey();
});
});
@@ -68,21 +70,22 @@ keys.create = function (keyName, file, callback) {
if (/private key/i.test(val)) {
jitsu.log.error(
'Private key detected. Stopping.'
- + ' Are you sure this is a public key?');
+ + ' Are you sure this is a'
+ + ' public'.bold + ' key?');
return callback(new Error(), true);
}
data.value = val;
- jitsu.log.info('Uploading public key...');
+ jitsu.log.info('Uploading public key.');
return createKey();
});
}
function createKey() {
jitsu.keys.create(user + '/keys/' + keyName, data, function (err, response) {
if (err) return callback(err);
- jitsu.log.help('Key successfully created.');
+ jitsu.log.info('Key successfully created.');
return callback();
});
}

0 comments on commit bea8585

Please sign in to comment.