From 938b123febed6eedc072b1ac172007368814fa59 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 11 Jul 2023 01:26:58 -0500 Subject: [PATCH] harden against spaces in pathnames --- devtest/compare.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/devtest/compare.sh b/devtest/compare.sh index 643d995..bc9ed76 100755 --- a/devtest/compare.sh +++ b/devtest/compare.sh @@ -5,29 +5,30 @@ # ./compare.sh gora ~/src/asf/gora-site main # -invoked=`dirname $0` -absdir=`realpath $invoked` -bindir=`dirname $absdir`/bin -#echo $bindir +invoked="`dirname $0`" +absdir="`realpath $invoked`" +bindir="`dirname $absdir`/bin" +#echo "$bindir" -project=$1 -source=$2 # URL or pathname to a local clone -branch=$3 +project="$1" +source="$2" # URL or pathname to a local clone +branch="$3" set -x +### maybe skip if already defined in ENV? export LIBCMARKDIR=/tmp/cm/cmark-gfm-0.28.3.gfm.12/lib -cd $source +cd "$source" # Get the branch where pelicanconf.* lives -git checkout $branch +git checkout "$branch" # Now build the site into /tmp/$project/ -$bindir/buildsite.py git --project $project --source $source --sourcebranch $branch || exit 1 +"$bindir/buildsite.py" git --project "$project" --source "$source" --sourcebranch "$branch" || exit 1 # Switch to what the current/prior website looks like git checkout asf-site # Give a quick summary of old/new site -diff -rq output /tmp/$project/source/output +diff -rq output "/tmp/$project/source/output"