X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=bin%2Fsetup.sh;h=1d5435622e1d29069b3006dc18b7d40d4a3d9476;hb=4c9d78eac913e15cba12bbaf780657519d02a433;hp=ef8de70c14df7799f51062ae47e4ba7b78e1afaa;hpb=cdeb4bdffdfc26d382057594206ed1f39721f6f6;p=civicrm-core.git diff --git a/bin/setup.sh b/bin/setup.sh index ef8de70c14..1d5435622e 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,9 +47,9 @@ fi # run code generator if it's there - which means it's # checkout, not packaged code -if [ -d $CALLEDPATH/../xml ]; then - cd $CALLEDPATH/../xml - "$PHP5PATH"php GenCode.php $SCHEMA +if [ -d "$CALLEDPATH/../xml" ]; then + cd "$CALLEDPATH/../xml" + "$PHP5PATH"php GenCode.php $SCHEMA '' $GENCODE_CMS fi # someone might want to use empty password for development, @@ -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" @@ -96,7 +97,7 @@ if [ ! -z $DBADD ]; then fi # run the cli script to build the menu and the triggers -cd $CALLEDPATH/.. +cd "$CALLEDPATH/.." "$PHP5PATH"php bin/cli.php -e System -a flush --triggers 1 --session 1 # reset config_backend and userFrameworkResourceURL which gets set