summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-04-28 10:04:43 -0700
committerelijah <elijah@riseup.net>2015-04-28 10:04:43 -0700
commit9a6b198873823d8deb6d405222a0eca28312ae0a (patch)
treef1d3cdb7aab891fe74f559743b4fc4a2c48d4829 /lib
parent44de719a21c80646125063e7a5f6dafc5cfc44ae (diff)
fail to compile if you pass it an invalid environment name
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/commands/compile.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/leap_cli/commands/compile.rb b/lib/leap_cli/commands/compile.rb
index 78d7520..cfafc74 100644
--- a/lib/leap_cli/commands/compile.rb
+++ b/lib/leap_cli/commands/compile.rb
@@ -12,8 +12,12 @@ module LeapCli
if !LeapCli.leapfile.environment.nil? && !environment.nil? && environment != LeapCli.leapfile.environment
bail! "You cannot specify an ENVIRONMENT argument while the environment is pinned."
end
- if environment && manager.environment_names.include?(environment)
- compile_hiera_files(manager.filter([environment]))
+ if environment
+ if manager.environment_names.include?(environment)
+ compile_hiera_files(manager.filter([environment]))
+ else
+ bail! "There is no environment named `#{environment}`."
+ end
else
compile_hiera_files(manager.filter)
end