From b83f2aab7ad592d0c13ae6294d9dfd018e8f1768 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 14 Mar 2012 14:32:31 -0400 Subject: [PATCH] Use `elif` instead of `else if` where possible to reduce nesting. --- dotfiles.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dotfiles.sh b/dotfiles.sh index 6bd279d..eb19aa0 100755 --- a/dotfiles.sh +++ b/dotfiles.sh @@ -199,11 +199,9 @@ function wget_fetch() if [ -n "${SERVER_ETAG}" ]; then # store new ETag REPO_SOURCE_DATA['etag']="${SERVER_ETAG}" set_repo_source "${REPO}" || return 1 - else - if [ -n "${ETAG}" ]; then # clear old ETag - unset "${REPO_SOURCE_DATA['etag']}" - set_repo_source "${REPO}" || return 1 - fi + elif [ -n "${ETAG}" ]; then # clear old ETag + unset "${REPO_SOURCE_DATA['etag']}" + set_repo_source "${REPO}" || return 1 fi echo "extracting ${BUNDLE} to ${REPO}" "${TAR}" -xf "${BUNDLE}" -C "${REPO}" --strip-components 1 --overwrite || return 1 @@ -433,10 +431,8 @@ function diff() if [ ! -e "${TARGET}/${FILE}" ]; then echo "${FILE}" fi - else - if [ -f "${TARGET}/${FILE}" ]; then - (cd "${REPO}/src" && "${DIFF}" -u "${FILE}" "${TARGET}/${FILE}") - fi + elif [ -f "${TARGET}/${FILE}" ]; then + (cd "${REPO}/src" && "${DIFF}" -u "${FILE}" "${TARGET}/${FILE}") fi done <<-EOF $(list_files "${REPO}/src") -- 2.26.2