From 0c2ade98ba78dc5ae853a0f10bb9cf429b72c946 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Mon, 21 Sep 2015 13:57:10 -0700 Subject: [PATCH] Fix `"insecure":true` in a profile This was broken in commit 99d9113eae6e6e8546d6d604868fe1e5050572fa --- lib/cli.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 90efba9..87a9814 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -244,7 +244,11 @@ CLI.prototype._applyProfileOverrides = function _applyProfileOverrides(profile) { var self = this; ['account', 'url', 'keyId', 'insecure'].forEach(function (field) { - if (self.opts.hasOwnProperty(field)) { + // We need to check `opts._order` to know if boolean opts + // were specified. + var specified = self.opts._order.filter( + function (opt) { return opt.key === field; }).length > 0; + if (specified) { profile[field] = self.opts[field]; } });