Skip to content

Commit

Permalink
Fix 'config' option usage in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
shev-vadim-net authored and glebm committed May 20, 2022
1 parent fee4e13 commit a2adc31
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/i18n/tasks/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ def start(argv)
def run(argv)
argv.each_with_index do |arg, i|
if ['--config', '-c'].include?(arg)
if File.exist?(argv[i + 1])
@config_file = argv[i + 1]
_, config_file = argv.slice!(i, 2)
if File.exist?(config_file)
@config_file = config_file
break
else
error "Config file doesn't exist: #{argv[i + 1]}", 128
error "Config file doesn't exist: #{config_file}", 128
end
end
end
Expand Down

0 comments on commit a2adc31

Please sign in to comment.