From 5e43f8f44d542787c4808a2b2f1bbc9892a14aa4 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 18 Oct 2013 16:44:41 +0530 Subject: [PATCH] setup.sh - Quote directory names (which may have spaces) --- bin/setup.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/setup.sh b/bin/setup.sh index ef8de70c14..7474b2baf4 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e CALLEDPATH=`dirname $0` @@ -24,11 +25,11 @@ fi # fetch command line arguments if available -if [ ! -z $1 ] ; then SCHEMA=$1; fi -if [ ! -z $2 ] ; then DBLOAD=$2; fi -if [ ! -z $3 ] ; then DBNAME=$3; fi -if [ ! -z $4 ] ; then DBUSER=$4; fi -if [ ! -z $5 ] ; then DBPASS=$5; fi +if [ ! -z "$1" ] ; then SCHEMA="$1"; fi +if [ ! -z "$2" ] ; then DBLOAD="$2"; fi +if [ ! -z "$3" ] ; then DBNAME="$3"; fi +if [ ! -z "$4" ] ; then DBUSER="$4"; fi +if [ ! -z "$5" ] ; then DBPASS="$5"; fi # verify if we have at least DBNAME given if [ -z $DBNAME ] ; then @@ -46,8 +47,8 @@ fi # run code generator if it's there - which means it's # checkout, not packaged code -if [ -d $CALLEDPATH/../xml ]; then - cd $CALLEDPATH/../xml +if [ -d "$CALLEDPATH/../xml" ]; then + cd "$CALLEDPATH/../xml" "$PHP5PATH"php GenCode.php $SCHEMA fi @@ -59,7 +60,7 @@ else PASSWDSECTION="-p$DBPASS" fi -cd $CALLEDPATH/../sql +cd "$CALLEDPATH/../sql" echo; echo "Dropping civicrm_* tables from database $DBNAME" # mysqladmin -f -u $DBUSER $PASSWDSECTION $DBARGS drop $DBNAME MYSQLCMD="mysql -u$DBUSER $PASSWDSECTION $DBARGS $DBNAME" -- 2.25.1