triton profile ... doesn't use the profile from TRITON_PROFILE envvar

Fixes #43
This commit is contained in:
Trent Mick 2015-10-14 11:45:41 -07:00
parent 2a0c7d9f55
commit f1e90cdab8
2 changed files with 7 additions and 3 deletions

View File

@ -2,6 +2,8 @@
## 2.1.3 (not yet released) ## 2.1.3 (not yet released)
- #43 `triton profile ...` doesn't use the profile from `TRITON_PROFILE` envvar
## 2.1.2 ## 2.1.2
- #41 Add compatibility with ed25519 keys in ssh-agent - #41 Add compatibility with ed25519 keys in ssh-agent

View File

@ -285,6 +285,7 @@ function _addProfile(opts, cb) {
assert.optionalString(opts.file, 'opts.file'); assert.optionalString(opts.file, 'opts.file');
assert.func(cb, 'cb'); assert.func(cb, 'cb');
var cli = opts.cli; var cli = opts.cli;
var log = cli.log;
var context; var context;
var data; var data;
@ -303,6 +304,7 @@ function _addProfile(opts, cb) {
try { try {
data = JSON.parse(stdin); data = JSON.parse(stdin);
} catch (err) { } catch (err) {
log.trace({stdin: stdin}, 'invalid profile JSON on stdin');
return next(new errors.TritonError( return next(new errors.TritonError(
format('invalid profile JSON on stdin: %s', err))); format('invalid profile JSON on stdin: %s', err)));
} }
@ -513,7 +515,7 @@ function do_profile(subcmd, opts, args, cb) {
case 'show': case 'show':
_showProfile({ _showProfile({
cli: this, cli: this,
name: args[0] || this.tritonapi.config.profile, name: args[0] || this.tritonapi.profile.name,
json: opts.json json: opts.json
}, cb); }, cb);
break; break;
@ -523,13 +525,13 @@ function do_profile(subcmd, opts, args, cb) {
case 'edit': case 'edit':
_editProfile({ _editProfile({
cli: this, cli: this,
name: args[0] || this.tritonapi.config.profile name: args[0] || this.tritonapi.profile.name
}, cb); }, cb);
break; break;
case 'delete': case 'delete':
_deleteProfile({ _deleteProfile({
cli: this, cli: this,
name: args[0] || this.tritonapi.config.profile, name: args[0],
force: Boolean(opts.force) force: Boolean(opts.force)
}, cb); }, cb);
break; break;