diff options
author | Anton Lundin <glance@acc.umu.se> | 2018-06-18 21:36:22 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-06-22 02:47:58 -0700 |
commit | 5f4006ae4f875cc6bdbc505de7816e7dce2eade0 (patch) | |
tree | 25c84d87859d7341749aa9a06cddf995a5a117f8 /scripts/get-dep-lib.sh | |
parent | 5df93e084d7be1cf3942fabc69bae884fcf5f1f4 (diff) | |
download | subsurface-5f4006ae4f875cc6bdbc505de7816e7dce2eade0.tar.gz |
build-system: Cleanup script with shellcheck
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Diffstat (limited to 'scripts/get-dep-lib.sh')
-rwxr-xr-x | scripts/get-dep-lib.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/get-dep-lib.sh b/scripts/get-dep-lib.sh index 909913c2d..bc76204f8 100755 --- a/scripts/get-dep-lib.sh +++ b/scripts/get-dep-lib.sh @@ -26,7 +26,7 @@ CURRENT_BREEZE_ICONS="" # url - repository url # git_checkout_library() { - [ $# -ne 3 ] && return -1 + [ $# -ne 3 ] && return 1 # for clarity local name=$1 @@ -45,7 +45,7 @@ git_checkout_library() { git fetch origin if ! git checkout "$version" ; then echo "Can't find the right tag in $name - giving up" - return -1 + return 1 fi fi popd @@ -59,7 +59,7 @@ git_checkout_library() { # filename - tarball file name # curl_download_library() { - [ $# -ne 3 ] && return -1 + [ $# -ne 3 ] && return 1 local name=$1 local base_url=$2 @@ -75,7 +75,7 @@ curl_download_library() { # deal with all the command line arguments -if [[ $# -ne 2 && $# -ne 3 ]] ; then +if [ $# -ne 2 ] && [ $# -ne 3 ] ; then echo "wrong number of parameters, format:" echo "get-dep-lib.sh <platform> <install dir>" echo "get-dep-lib.sh single <install dir> <lib>" @@ -90,9 +90,9 @@ fi PLATFORM=$1 INSTDIR=$2 -if [ ! -d ${INSTDIR} ] ; then +if [ ! -d "${INSTDIR}" ] ; then echo "creating dir" - mkdir -p ${INSTDIR} + mkdir -p "${INSTDIR}" fi # FIX FOR ANDROID, @@ -102,7 +102,7 @@ if [ "$PLATFORM" == "singleAndroid" ] ; then fi # no curl and old libs (never version breaks) # check whether to use curl or wget -if [ "`which curl`" == "" ] ; then +if [ "$(which curl)" == "" ] ; then CURL="wget " else CURL="curl -O " @@ -134,7 +134,7 @@ set -x set -e # get ready to download needed sources -cd ${INSTDIR} +cd "${INSTDIR}" if [[ "$BUILD" = *"libcurl"* ]]; then git_checkout_library libcurl $CURRENT_LIBCURL https://github.com/curl/curl.git |