Skip to content
Snippets Groups Projects
Commit 1d797300 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: make calling skripts more cwd independent

parent c908d69b
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,11 @@
# Dump a database with all procedures, permissions, structure and data
if [ -z "$UTILSPATH" ]; then
UTILSPATH="$(realpath $(dirname $0))"
export UTILSPATH
MAINPATH="$(dirname $UTILSPATH)"
export MAINPATH
fi
# The directory which the dump is to be stored to. Do not change it here. Use
# the --backupdir=./my/dir/ option or an environment variable instead.
......
......@@ -23,6 +23,11 @@
# - .config (in the current directory)
# - The file given in ENV_FILE.
if [ "$MAINPATH" ]; then
pushd "$MAINPATH" > /dev/null
pushed=1
fi
if [[ -r "config.defaults" ]] ; then
source "config.defaults"
fi
......@@ -38,6 +43,10 @@ if [[ -z "$MYSQL_CMD" ]] ; then
exit 1
fi
if [ $pushed ]; then
popd > /dev/null
fi
export MYSQL_CMD
export MYSQLDUMP_CMD
export MYSQLADMIN_CMD
......
......@@ -29,6 +29,8 @@ INSTALL_SQL_FILE="db_2_0.sql"
if [ -z "$UTILSPATH" ]; then
UTILSPATH="$(realpath $(dirname $0))"
export UTILSPATH
MAINPATH="$(dirname $UTILSPATH)"
export MAINPATH
fi
source $UTILSPATH/load_settings.sh
......
......@@ -27,6 +27,8 @@
if [ -z "$UTILSPATH" ]; then
UTILSPATH=$(realpath "$(dirname $0)")
export UTILSPATH
MAINPATH="$(dirname $UTILSPATH)"
export MAINPATH
fi
source $UTILSPATH/helpers.sh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment