Skip to content

Commit 40ff0fc

Browse files
authored
Merge pull request #1012 from czardien/fix
Fix unary operator expected error
2 parents 943b453 + d0dfcc3 commit 40ff0fc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎bin/mw‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ alias mbsync='mbsync -c "$mbsyncrc"'
3434
# mbsync >=1.4.0 requires "Far/Near" rather than "Master/Slave."
3535
mbver="$(mbsync -v)"
3636
mbver="${mbver#* }"
37-
if [ "${mbver%.*}" >= 1.4 ]; then
37+
mbver="${mbver%.*}"
38+
# Comparing two float numbers in bash is a pain in the butt, so we get rid of
39+
# dots and turn them into nice integers
40+
mbver="${mbver/\./}"
41+
if [ "${mbver}" -gt 14 ]; then
3842
master="Far"
3943
slave="Near"
4044
else

0 commit comments

Comments
 (0)