diff options
author | Mark Allen <[email protected]> | 2016-04-19 21:16:29 -0500 |
---|---|---|
committer | Mark Allen <[email protected]> | 2016-04-19 21:16:29 -0500 |
commit | 726bc6017f80a2b7064f97bc69dcbd565974f013 (patch) | |
tree | 4009757b7e2579a2a843d10c529d0bbcc5583b0f | |
parent | a1267ac340042d41cd8d8e62b776bc4f8d322631 (diff) | |
download | kerl-726bc6017f80a2b7064f97bc69dcbd565974f013.tar.gz kerl-726bc6017f80a2b7064f97bc69dcbd565974f013.tar.bz2 kerl-726bc6017f80a2b7064f97bc69dcbd565974f013.zip |
Rewrite get_newest_valid_release more simply
-rwxr-xr-x | kerl | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 } |