Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show org and app on every command #94

Merged
merged 11 commits into from
Nov 14, 2023
4 changes: 2 additions & 2 deletions lib/core/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Config # rubocop:disable Metrics/ClassLength
def initialize(args, options)
@args = args
@options = options
@org = options[:org]
@org = options[:org]&.strip
ahangarha marked this conversation as resolved.
Show resolved Hide resolved
@org_comes_from_env = true if ENV.fetch("CPLN_ORG", nil)
@app = options[:app]
@app = options[:app]&.strip

load_app_config
load_apps
Expand Down
7 changes: 4 additions & 3 deletions lib/cpl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,15 @@ def self.all_base_commands

def show_info_header(config)
rows = {}
rows["ORG"] = config.org unless config.org.nil? || config.org.empty?
rows["APP"] = config.app unless config.app.nil? || config.app.empty?
rows["ORG"] = config.org || "NOT PROVIDED!"
rows["APP"] = config.app || "NOT PROVIDED!"

rows.each do |key, value|
puts "#{key}: #{value}"
end

puts unless rows.empty?
# Add a newline after the info header
puts
end
ahangarha marked this conversation as resolved.
Show resolved Hide resolved
end
end
Expand Down