commit 40ff0fc93f0484c42e516ea536c1d1ed9addd36c parent 943b45340ce6d0249e1e8fc608718a13045584d3 Author: Luke Smith <luke@lukesmith.xyz> Date: Mon, 31 Mar 2025 15:44:12 +0000 Merge pull request #1012 from czardien/fix Fix unary operator expected error Diffstat:
M | bin/mw | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bin/mw b/bin/mw @@ -34,7 +34,11 @@ alias mbsync='mbsync -c "$mbsyncrc"' # mbsync >=1.4.0 requires "Far/Near" rather than "Master/Slave." mbver="$(mbsync -v)" mbver="${mbver#* }" -if [ "${mbver%.*}" >= 1.4 ]; then +mbver="${mbver%.*}" +# Comparing two float numbers in bash is a pain in the butt, so we get rid of +# dots and turn them into nice integers +mbver="${mbver/\./}" +if [ "${mbver}" -gt 14 ]; then master="Far" slave="Near" else