diff options
| author | Misty De Meo | 2017-05-24 09:12:21 -0700 |
|---|---|---|
| committer | Misty De Meo | 2017-05-24 09:12:21 -0700 |
| commit | 67dc3323ed1368ffc6a49899c8b98732dc2eb181 (patch) | |
| tree | 0df200be7657103896cd6d5ab32ad09edc94ff22 /Library/Homebrew/utils | |
| parent | 94ed3e358399db37ff88c8a53c6c8cbf7a44e51e (diff) | |
| download | brew-67dc3323ed1368ffc6a49899c8b98732dc2eb181.tar.bz2 | |
lock: simplify ruby conditional
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/lock.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/lock.sh b/Library/Homebrew/utils/lock.sh index b3c23c3ef..7f2bb8b73 100644 --- a/Library/Homebrew/utils/lock.sh +++ b/Library/Homebrew/utils/lock.sh @@ -42,7 +42,7 @@ _create_lock() { [[ -x "$ruby" ]] || ruby="$(which ruby 2>/dev/null)" [[ -x "$python" ]] || python="$(which python 2>/dev/null)" - if [[ -x "$ruby" && $("$ruby" -e "puts RUBY_VERSION >= '1.8.7' ? 0 : 1") = 0 ]] + if [[ -x "$ruby" ]] && "$ruby" -e "exit(RUBY_VERSION >= '1.8.7')" then "$ruby" -e "File.new($lock_fd).flock(File::LOCK_EX | File::LOCK_NB) || exit(1)" elif [[ -x "$(which flock)" ]] |
