Skip to content
Snippets Groups Projects
Unverified Commit b1c5d47c authored by Daniel's avatar Daniel
Browse files

FIX: Load definitions first.

parent ed5c4d9c
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Copyright (C) 2018 Research Group Biomedical Physics, # Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen # Max-Planck-Institute for Dynamics and Self-Organization Göttingen
# Copyright 2019 Daniel Hornung # Copyright 2019, 2020 Daniel Hornung
# Copyright 2020 Henrik tom Wörden, IndiScale GmbH # Copyright 2020 Henrik tom Wörden, IndiScale GmbH
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
...@@ -19,10 +19,20 @@ ...@@ -19,10 +19,20 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
###############################################################################
# Helper function definitions #
###############################################################################
# When sourcing this file, the following variables must be set:
#
# MYSQL_CMD : source $UTILSPATH/load_settings.sh
function mysql_execute { function mysql_execute {
#TODO is it meaningful that here always the database user is used??? #TODO is it meaningful that here always the database user is used???
set +e set +e
env
$MYSQL_CMD $(get_db_args) -e "$1" $MYSQL_CMD $(get_db_args) -e "$1"
ret=${PIPESTATUS[0]} ret=${PIPESTATUS[0]}
if [ "$ret" -ne 0 ]; then if [ "$ret" -ne 0 ]; then
......
...@@ -24,7 +24,13 @@ ...@@ -24,7 +24,13 @@
# Updates all SQL procedures # Updates all SQL procedures
if [ -z "$UTILSPATH" ]; then
UTILSPATH=$(realpath "$(dirname $0)")
export UTILSPATH
fi
source $UTILSPATH/helpers.sh source $UTILSPATH/helpers.sh
source $UTILSPATH/load_settings.sh
echo -n "updating rules ... " echo -n "updating rules ... "
set -e set -e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment