From 3a99d8093ca444c1039691387809f914f9a4a17c Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Wed, 6 Apr 2016 01:31:03 +0200 Subject: [PATCH] brew.sh: streamline setting HOMEBREW_{OSX,LINUX} For uses like this one, `case` is much more compact and easier to read. --- Library/brew.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Library/brew.sh b/Library/brew.sh index 7c5d07bf4c..a9a11c3688 100644 --- a/Library/brew.sh +++ b/Library/brew.sh @@ -58,13 +58,10 @@ then fi HOMEBREW_SYSTEM="$(uname -s)" -if [[ "$HOMEBREW_SYSTEM" = "Darwin" ]] -then - HOMEBREW_OSX="1" -elif [[ "$HOMEBREW_SYSTEM" = "Linux" ]] -then - HOMEBREW_LINUX="1" -fi +case "$HOMEBREW_SYSTEM" in + Darwin) HOMEBREW_OSX="1";; + Linux) HOMEBREW_LINUX="1";; +esac if [[ -z "$HOMEBREW_RUBY_PATH" ]] then