From 0ddc8a54ee0bd8357d0546ed5e0057115ce8afec Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 15 Jun 2014 18:52:37 -0700 Subject: Use highest matching version. --- rpath.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rpath.sh b/rpath.sh index 7ba2d90..3f05790 100755 --- a/rpath.sh +++ b/rpath.sh @@ -120,15 +120,15 @@ rpath_set() { for dir in "${dirs[@]}"; do if [[ "${dir##*/}" == *"${1}"* ]]; then - _clear - _add "${dir}" - _export - - return + match="${dir}" fi done - _die 'no matching ruby found.' + [[ -n "${match}" ]] || _die 'no matching ruby found.' + + _clear + _add "${match}" + _export } rpath_clear() { -- cgit v1.2.3-70-g09d2