diff --git a/build/actions/environment-variables.js b/build/actions/environment-variables.js index 7e751aa4..a79ad92e 100644 --- a/build/actions/environment-variables.js +++ b/build/actions/environment-variables.js @@ -37,6 +37,9 @@ } }).tap(function(environmentVariables) { var isSystemVariable; + if (_.isEmpty(environmentVariables)) { + throw new Error('No environment variables found'); + } if (!options.verbose) { isSystemVariable = resin.models.environmentVariables.isSystemVariable; environmentVariables = _.reject(environmentVariables, isSystemVariable); diff --git a/lib/actions/environment-variables.coffee b/lib/actions/environment-variables.coffee index 9a4d49ab..f1628527 100644 --- a/lib/actions/environment-variables.coffee +++ b/lib/actions/environment-variables.coffee @@ -44,6 +44,8 @@ exports.list = throw new Error('You must specify an application or device') .tap (environmentVariables) -> + if _.isEmpty(environmentVariables) + throw new Error('No environment variables found') if not options.verbose isSystemVariable = resin.models.environmentVariables.isSystemVariable environmentVariables = _.reject(environmentVariables, isSystemVariable)