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 @@
#
# Copyright (C) 2018 Research Group Biomedical Physics,
# 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
#
# This program is free software: you can redistribute it and/or modify
......@@ -19,16 +19,26 @@
# 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 {
#TODO is it meaningful that here always the database user is used???
set +e
env
$MYSQL_CMD $(get_db_args) -e "$1"
ret=${PIPESTATUS[0]}
if [ "$ret" -ne 0 ]; then
failure "MYSQL ERROR"
fi
set -e
$MYSQL_CMD $(get_db_args) -e "$1"
ret=${PIPESTATUS[0]}
if [ "$ret" -ne 0 ]; then
failure "MYSQL ERROR"
fi
set -e
}
function get_mysql_args {
......
......@@ -24,7 +24,13 @@
# Updates all SQL procedures
if [ -z "$UTILSPATH" ]; then
UTILSPATH=$(realpath "$(dirname $0)")
export UTILSPATH
fi
source $UTILSPATH/helpers.sh
source $UTILSPATH/load_settings.sh
echo -n "updating rules ... "
set -e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment