Skip to content

Commit

Permalink
#49 Improve logs, replacing raw puts with UI.warn and UI.crash
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerluan authored Oct 21, 2023
2 parents 7984722 + b898a72 commit 1e9c56a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/arkana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_relative "arkana/config_parser"
require_relative "arkana/encoder"
require_relative "arkana/helpers/dotenv_helper"
require_relative "arkana/helpers/ui"
require_relative "arkana/models/template_arguments"
require_relative "arkana/salt_generator"
require_relative "arkana/swift_code_generator"
Expand Down Expand Up @@ -30,11 +31,11 @@ def self.run(arguments)
)
rescue StandardError => e
# TODO: Improve this by creating an Env/Debug helper
puts("Something went wrong when parsing and encoding your secrets.")
puts("Current Flavor: #{config.current_flavor}")
puts("Dotenv Filepath: #{config.dotenv_filepath}")
puts("Config Filepath: #{arguments.config_filepath}")
raise e
UI.warn("Something went wrong when parsing and encoding your secrets.")
UI.warn("Current Flavor: #{config.current_flavor}")
UI.warn("Dotenv Filepath: #{config.dotenv_filepath}")
UI.warn("Config Filepath: #{arguments.config_filepath}")
UI.crash(e.message)
end
template_arguments = TemplateArguments.new(
environment_secrets: environment_secrets,
Expand Down

0 comments on commit 1e9c56a

Please sign in to comment.