From 5635f7377fe95c4b1ade5052a68884f39b4ab387 Mon Sep 17 00:00:00 2001 From: Alex Leong Date: Tue, 2 Jun 2020 13:02:07 -0700 Subject: [PATCH] Fix uname flags for darwin in bin/lint (#4490) The version of `uname` on Darwin doesn't support the `-o` flag, resulting in an error message when running the `bin/lint` script. We add an if-branch to short-circuit the `uname-o` call if running on Darwin. Signed-off-by: Alex Leong --- bin/lint | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/lint b/bin/lint index 79837ac99..25b0ae2c1 100755 --- a/bin/lint +++ b/bin/lint @@ -13,7 +13,10 @@ targetbin=$rootdir/target/bin cd "$rootdir" exe= -if [ "$(uname -o)" = Msys ]; then +if [ "$(uname -s)" = Darwin ]; then + # Darwin's uname doesn't support the -o flag so we short circuit here. + :; +elif [ "$(uname -o)" = Msys ]; then exe=.exe fi