From: W. Trevor King Date: Wed, 14 Mar 2012 18:32:31 +0000 (-0400) Subject: Use `elif` instead of `else if` where possible to reduce nesting. X-Git-Tag: v0.3~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b83f2aab7ad592d0c13ae6294d9dfd018e8f1768;p=dotfiles-framework.git Use `elif` instead of `else if` where possible to reduce nesting. --- 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")