From ae2936655c50e369c0150ff4c049cdcf696848a7 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 14 Mar 2014 17:45:32 -0700 Subject: added ability to define environment specific provider.json (e.g. provider.production.json) --- lib/leap_cli/commands/inspect.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/leap_cli/commands/inspect.rb') diff --git a/lib/leap_cli/commands/inspect.rb b/lib/leap_cli/commands/inspect.rb index 23c75bb..746a80c 100644 --- a/lib/leap_cli/commands/inspect.rb +++ b/lib/leap_cli/commands/inspect.rb @@ -39,7 +39,7 @@ module LeapCli; module Commands :inspect_service elsif path_match?(:tag_config, full_path) :inspect_tag - elsif path_match?(:provider_config, full_path) + elsif path_match?(:provider_config, full_path) || path_match?(:provider_env_config, full_path) :inspect_provider elsif path_match?(:common_config, full_path) :inspect_common @@ -108,6 +108,8 @@ module LeapCli; module Commands def inspect_provider(arg, options) if options[:base] inspect_json manager.base_provider + elsif arg =~ /provider\.(.*)\.json/ + inspect_json manager.providers[$1] else inspect_json manager.provider end @@ -130,7 +132,9 @@ module LeapCli; module Commands end def inspect_json(config) - puts JSON.sorted_generate(config) + if config + puts JSON.sorted_generate(config) + end end def path_match?(path_symbol, path) -- cgit v1.2.3