mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-27 07:33:05 +00:00
clean code
This commit is contained in:
parent
dbfe118490
commit
b71f98d238
1 changed files with 6 additions and 9 deletions
|
@ -76,19 +76,16 @@ class Cli
|
|||
sync_host = ask(I18n.t('form.setup.sync_host')).to_s
|
||||
sync_port = ask(I18n.t('form.setup.sync_port')).to_s
|
||||
sync_pwd = ask(I18n.t('form.setup.sync_pwd')).to_s
|
||||
sync_suffix = ask(I18n.t('form.setup.sync_suffix')).to_s
|
||||
sync_path = ask(I18n.t('form.setup.sync_path')).to_s
|
||||
|
||||
if !File.exist?("#{APP_ROOT}/i18n/#{language}.yml")
|
||||
language= 'en'
|
||||
end
|
||||
I18n.locale = language.to_sym
|
||||
|
||||
sync_host = sync_host.empty? ? nil : sync_host
|
||||
sync_port = sync_port.empty? ? nil : sync_port.to_i
|
||||
sync_pwd = sync_pwd.empty? ? nil : sync_pwd
|
||||
sync_suffix = sync_suffix.empty? ? nil : sync_suffix
|
||||
sync_path = sync_path.empty? ? nil : sync_path
|
||||
|
||||
if @config.setup(key, language, file_gpg, timeout_pwd, sync_host, sync_port, sync_pwd, sync_suffix)
|
||||
if @config.setup(key, language, file_gpg, timeout_pwd, sync_host, sync_port, sync_pwd, sync_path)
|
||||
puts I18n.t('form.setup.valid')
|
||||
else
|
||||
puts "#{I18n.t('display.error')}: #{@config.error_msg}"
|
||||
|
|
Loading…
Reference in a new issue