bin/sync_dir in utils-0.43.0 vs bin/sync_dir in utils-0.44.0
- old
+ new
@@ -49,19 +49,22 @@
puts <<~end
(C)opy #{s.inspect} to #{d.inspect}
(E)dit #{s.inspect}
(D)elete #{s.inspect}
(S)kip
+ (Q)uit
end
case ask?(prompt: 'action? ')
when /\Ac/i
cp s, d
when /\Ae/i
system "vim #{s.inspect}"
redo
when /\Ad/i
rm s
+ when /\Aq/i
+ exit
end
when /^Files (.*?) and (.*?) differ$/
s, d = $~.captures
s = local_path(s)
$config.sync_dir.skip?(s) and next
@@ -69,12 +72,19 @@
puts `diff --color=always -u #{s.inspect} #{d.inspect}`
puts " Difference found #{s.inspect} #{d.inspect} ".center(Tins::Terminal.cols, ?*)
puts <<~end
(V)imdiff
(S)kip
+ (Q)uit
end
- ask?(prompt: 'action? ') =~ /\Av/i or next
- system "vimdiff #{s.inspect} #{d.inspect}"
+ case ask?(prompt: 'action? ')
+ when /\Av/i
+ system "vimdiff #{s.inspect} #{d.inspect}"
+ when /\Aq/i
+ exit
+ else
+ next
+ end
redo
end
rescue Interrupt
exit
end