Skip to content

Commit

Permalink
[#144] Delete excessive normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
antlu committed Aug 19, 2022
1 parent 285d17d commit 3bc31b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/uffizzi/cli/login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ def run

def set_server
config_server = ConfigFile.exists? ? read_option_from_config(:server) : nil
server_address = @options[:server] || config_server || Uffizzi.ui.ask('Server: ')
server_address = (@options[:server] || config_server || Uffizzi.ui.ask('Server:')).delete_suffix('/')
server_address.start_with?('http:', 'https:') ? server_address : "https://#{server_address}"
end

def set_username
config_username = ConfigFile.exists? ? read_option_from_config(:username) : nil
@options[:username] || config_username || Uffizzi.ui.ask('Username: ')
@options[:username] || config_username || Uffizzi.ui.ask('Username:')
end

def set_password
ENV['UFFIZZI_PASSWORD'] || Uffizzi.ui.ask('Password: ', echo: false)
ENV['UFFIZZI_PASSWORD'] || Uffizzi.ui.ask('Password:', echo: false)
end

def read_option_from_config(option)
Expand Down
2 changes: 1 addition & 1 deletion lib/uffizzi/cli/preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def display_deployment_data(deployment, success)
end

def build_deployment_data(deployment)
url_server = ConfigFile.read_option(:server).strip.gsub(/\/*$/, '')
url_server = ConfigFile.read_option(:server)

{
id: "deployment-#{deployment[:id]}",
Expand Down

0 comments on commit 3bc31b3

Please sign in to comment.