lib/gooddata/cli/hooks.rb in gooddata-0.6.7 vs lib/gooddata/cli/hooks.rb in gooddata-0.6.8
- old
+ new
@@ -1,19 +1,21 @@
# encoding: UTF-8
require 'gli'
require 'pp'
+require_relative '../helpers/auth_helpers'
+
GoodData::CLI.module_eval do
pre do |global, command, options, args|
require 'logger'
GoodData.logger = Logger.new(STDOUT) if global[:l]
username = global[:username]
password = global[:password]
token = global[:token]
- creds = GoodData::Command::Auth.read_credentials
+ creds = GoodData::Helpers::AuthHelper.read_credentials
username = creds[:username] if username.nil?
password = creds[:password] if password.nil?
token = creds[:auth_token] if token.nil?
@@ -37,9 +39,9 @@
on_error do |exception|
# Error logic here
# return false to skip default error handling
# binding.pry
# pp exception.backtrace
- pp exception
+ # pp exception
true
end
end