From 02b481ae2ec13d0b999acb5ef2f4fb0a33233834 Mon Sep 17 00:00:00 2001 From: Chris Carpita Date: Tue, 7 Oct 2014 16:11:46 -0400 Subject: [PATCH] Shorten line, fix fallback array formatting Change-Id: I911e69a115bf9c6f5e029626480aa83b63f2c09e --- lib/install/install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/install/install.sh b/lib/install/install.sh index 2e7392a..ece9009 100755 --- a/lib/install/install.sh +++ b/lib/install/install.sh @@ -6,16 +6,17 @@ CONFIG_FILE="$HOME/.bpkgrc" ## set defaults if [ ${#BPKG_REMOTES[@]} -eq 0 ]; then - BPKG_REMOTES=("${BPKG_REMOTE-https://raw.githubusercontent.com}") - BPKG_GIT_REMOTES=("${BPKG_GIT_REMOTE-https://github.com}") + BPKG_REMOTES[0]=${BPKG_REMOTE-https://raw.githubusercontent.com} + BPKG_GIT_REMOTES[0]=${BPKG_GIT_REMOTE-https://github.com} fi BPKG_USER="${BPKG_USER:-"bpkg"}" ## check parameter consistency validate_parameters () { if [ ${#BPKG_GIT_REMOTES[@]} -ne ${#BPKG_REMOTES[@]} ]; then - mesg=`printf "BPKG_GIT_REMOTES differs in size from BPKG_REMOTES array (%d vs %d elements)\n" "${#BPKG_GIT_REMOTES[@]}" "${#BPKG_REMOTES[@]}"` - error "$mesg" + mesg='BPKG_GIT_REMOTES[%d] differs in size from BPKG_REMOTES[%d] array' + fmesg=$(printf "$mesg" "${#BPKG_GIT_REMOTES[@]}" "${#BPKG_REMOTES[@]}") + error "$fmesg" return 1 fi return 0