diff --git a/lib/mpw/ui/cli.rb b/lib/mpw/ui/cli.rb index d72d597..433df6f 100644 --- a/lib/mpw/ui/cli.rb +++ b/lib/mpw/ui/cli.rb @@ -104,11 +104,14 @@ class Cli puts I18n.t('form.setup_wallet.title') puts '--------------------' config['sync']['type'] = ask(I18n.t('form.setup_wallet.sync_type')).to_s - config['sync']['host'] = ask(I18n.t('form.setup_wallet.sync_host')).to_s - config['sync']['port'] = ask(I18n.t('form.setup_wallet.sync_port')).to_s - config['sync']['user'] = ask(I18n.t('form.setup_wallet.sync_user')).to_s - config['sync']['password'] = ask(I18n.t('form.setup_wallet.sync_pwd')).to_s - config['sync']['path'] = ask(I18n.t('form.setup_wallet.sync_path')).to_s + + if ['ftp', 'ssh'].include?(config['sync']['type'].downcase) + config['sync']['host'] = ask(I18n.t('form.setup_wallet.sync_host')).to_s + config['sync']['port'] = ask(I18n.t('form.setup_wallet.sync_port')).to_s + config['sync']['user'] = ask(I18n.t('form.setup_wallet.sync_user')).to_s + config['sync']['password'] = ask(I18n.t('form.setup_wallet.sync_pwd')).to_s + config['sync']['path'] = ask(I18n.t('form.setup_wallet.sync_path')).to_s + end @mpw.set_config(config) @mpw.write_data