diff --git a/lib/commands/dash.js b/lib/commands/dash.js index 4fa1678c0..1a1f84232 100644 --- a/lib/commands/dash.js +++ b/lib/commands/dash.js @@ -71,20 +71,17 @@ CMD.prototype.run = Promise.method(function() { _this._resources = selectedResources; if (!_this._resources.length) { return false; - } else { - - // TODO: Untag all other resources - - return _this._resources; } + return _this._choices; }) .each(function(resource) { + var toggled = (!!resource.toggled || false); if (resource.type === 'lambda') { _this._report.targetLambdas++; - return CMDtag.tag('lambda', resource.value, false); + return CMDtag.tag('lambda', resource.value, !toggled); } else if (resource.type === 'endpoint') { _this._report.targetEndpoints++; - return CMDtag.tag('endpoint', resource.value, false); + return CMDtag.tag('endpoint', resource.value, !toggled); } }); } @@ -97,6 +94,9 @@ CMD.prototype.run = Promise.method(function() { JawsCli.log(chalk.white('-------------------------------------------')); JawsCli.log(chalk.white(' Dashboard: Deploying Lambdas...')); JawsCli.log(chalk.white('-------------------------------------------')); + if (!_this._report.targetLambdas) { + return JawsCli.log(chalk.white('No Selected Lambdas to deploy.')); + } return CMDdeployLambda.run( _this._JAWS, @@ -110,6 +110,9 @@ CMD.prototype.run = Promise.method(function() { JawsCli.log(chalk.white('-------------------------------------------')); JawsCli.log(chalk.white(' Dashboard: Deploying Endpoints...')); JawsCli.log(chalk.white('-------------------------------------------')); + if (!_this._report.targetEndpoints) { + return JawsCli.log(chalk.white('No Selected Endpoints to deploy.')); + } return CMDdeployEndpoint.run( _this._JAWS, @@ -366,4 +369,4 @@ CMD.prototype._promptRegion = Promise.method(function() { _this._regions = [results[0].value]; } }); -}); \ No newline at end of file +});