aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
authorMark Allen <[email protected]>2016-04-19 21:16:29 -0500
committerMark Allen <[email protected]>2016-04-19 21:16:29 -0500
commit726bc6017f80a2b7064f97bc69dcbd565974f013 (patch)
tree4009757b7e2579a2a843d10c529d0bbcc5583b0f /kerl
parenta1267ac340042d41cd8d8e62b776bc4f8d322631 (diff)
downloadkerl-726bc6017f80a2b7064f97bc69dcbd565974f013.tar.gz
kerl-726bc6017f80a2b7064f97bc69dcbd565974f013.tar.bz2
kerl-726bc6017f80a2b7064f97bc69dcbd565974f013.zip
Rewrite get_newest_valid_release more simply
Diffstat (limited to 'kerl')
-rwxr-xr-xkerl14
1 files changed, 8 insertions, 6 deletions
diff --git a/kerl b/kerl
index e90ba5e..d1a5702 100755
--- a/kerl
+++ b/kerl
@@ -219,12 +219,14 @@ get_release_from_name()
get_newest_valid_release()
{
check_releases
- while read -r rel; do
- if [ ! -z "$rel" ]; then
- echo "$rel"
- return 0
- fi
- done < "$KERL_BASE_DIR"/otp_releases | tail -1
+
+ rel=$(tail -1 "$KERL_BASE_DIR"/otp_releases)
+
+ if [ ! -z "$rel" ]; then
+ echo "$rel"
+ return 0
+ fi
+
return 1
}