aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/commands/compile.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/compile.rb b/lib/leap_cli/commands/compile.rb
index 63c2047..eaedfbf 100644
--- a/lib/leap_cli/commands/compile.rb
+++ b/lib/leap_cli/commands/compile.rb
@@ -5,9 +5,15 @@ module LeapCli
desc "Compile generated files."
command :compile do |c|
c.desc 'Compiles node configuration files into hiera files used for deployment.'
+ c.arg_name 'ENVIRONMENT', :optional => true
c.command :all do |all|
all.action do |global_options,options,args|
- compile_hiera_files
+ environment = args.first
+ if environment && manager.environment_names.include?(environment)
+ compile_hiera_files(manager.filter(args))
+ else
+ compile_hiera_files
+ end
end
end