aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/inspect.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-03-14 17:45:32 -0700
committerelijah <elijah@riseup.net>2014-03-14 17:45:32 -0700
commitae2936655c50e369c0150ff4c049cdcf696848a7 (patch)
tree20d341abf719333b52b9c65db4fae25684fb9c14 /lib/leap_cli/commands/inspect.rb
parent2c2125b372bcfc69764f8f2a2ec6a1410f2e0669 (diff)
downloadleap_cli-ae2936655c50e369c0150ff4c049cdcf696848a7.tar.gz
leap_cli-ae2936655c50e369c0150ff4c049cdcf696848a7.tar.bz2
added ability to define environment specific provider.json (e.g. provider.production.json)
Diffstat (limited to 'lib/leap_cli/commands/inspect.rb')
-rw-r--r--lib/leap_cli/commands/inspect.rb8
1 files changed, 6 insertions, 2 deletions
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)