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)
- #43 `triton profile ...` doesn't use the profile from `TRITON_PROFILE` envvar
## 2.1.2
- #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.func(cb, 'cb');
var cli = opts.cli;
var log = cli.log;
var context;
var data;
@ -303,6 +304,7 @@ function _addProfile(opts, cb) {
try {
data = JSON.parse(stdin);
} catch (err) {
log.trace({stdin: stdin}, 'invalid profile JSON on stdin');
return next(new errors.TritonError(
format('invalid profile JSON on stdin: %s', err)));
}
@ -513,7 +515,7 @@ function do_profile(subcmd, opts, args, cb) {
case 'show':
_showProfile({
cli: this,
name: args[0] || this.tritonapi.config.profile,
name: args[0] || this.tritonapi.profile.name,
json: opts.json
}, cb);
break;
@ -523,13 +525,13 @@ function do_profile(subcmd, opts, args, cb) {
case 'edit':
_editProfile({
cli: this,
name: args[0] || this.tritonapi.config.profile
name: args[0] || this.tritonapi.profile.name
}, cb);
break;
case 'delete':
_deleteProfile({
cli: this,
name: args[0] || this.tritonapi.config.profile,
name: args[0],
force: Boolean(opts.force)
}, cb);
break;