From 401cfb2905a9b955ca2ab0e63d312ebabd747e47 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 1 Oct 2014 17:51:56 -0600 Subject: [PATCH] Fail in library files that have whitespace after the dir --- build.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index b621cde..62bf528 100755 --- a/build.sh +++ b/build.sh @@ -154,11 +154,15 @@ for repoTag in "${repos[@]}"; do tags=() for line in "${repoTagLines[@]}"; do tag="$(echo "$line" | awk -F ': +' '{ print $1 }')" - fullGitUrl="$(echo "$line" | awk -F ' +' '{ print $2 }')" - gitDir="$(echo "$line" | awk -F ' +' '{ print $3 }')" + repoDir="$(echo "$line" | awk -F ': +' '{ print $2 }')" - gitUrl="${fullGitUrl%%@*}" - gitRef="${fullGitUrl#*@}" + gitUrl="${repoDir%%@*}" + commitDir="${repoDir#*@}" + gitRef="${commitDir%% *}" + gitDir="${commitDir#* }" + if [ "$gitDir" = "$commitDir" ]; then + gitDir='' + fi gitRepo="${gitUrl#*://}" gitRepo="${gitRepo%/}" @@ -231,7 +235,7 @@ while [ "$#" -gt 0 ]; do # TODO git tag if [ ! -d "$gitRepo/$gitDir" ]; then - echo "- failed; invalid dir: $gitDir" + echo "- failed; invalid dir: '$gitDir'" didFail=1 continue fi