diff --git a/CHANGES.md b/CHANGES.md index 8aa7d9c..55e5dac 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/lib/do_profile.js b/lib/do_profile.js index 437d4ab..0b27cb0 100644 --- a/lib/do_profile.js +++ b/lib/do_profile.js @@ -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;