diff --git a/pgmodeler.vars b/pgmodeler.vars index 7a7fbdddce..51572d259a 100644 --- a/pgmodeler.vars +++ b/pgmodeler.vars @@ -19,12 +19,12 @@ # If you have a custom Qt installation at /opt/qt-5.9.6 for example, the path to the command above should be # /opt/qt-5.9.6/5.9.6/gcc_64 # -# NOTE: Use the configuration below only if you have a custom Qt installation other than as defined by +# NOTE: Use the configuration below only if you have a custom Qt installation other than as defined by # your system or if Qt isn't included/installed by default on your distro. # Replace the value of this variable by the full path to "qtpaths" if you have a custom Qt installation -# export QT_PATHS_BIN=qtpaths +# export QT_PATHS_BIN=qtpaths # Qt's main environment variables # export QT_ROOT="$($QT_PATHS_BIN --install-prefix)" @@ -32,14 +32,22 @@ # export QT_PLUGIN_PATH="$($QT_PATHS_BIN --plugin-dir)" # Change the "lib64" by "lib" if you're running a 32 bit system -# export QT_LIBS="$QT_ROOT/lib64" +# export QT_LIBS="$QT_ROOT/lib64" # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$QT_LIBS" # export PATH=$PATH:"$QT_BIN" # --- [ End custom configuration ] --- +# Resolve absolute path to this file +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + PGMODELER_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done + # Specify here the full path to the pgmodeler's root directory -export PGMODELER_ROOT="$(dirname "$(readlink -f "$0")")" +export PGMODELER_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )" export PGMODELER_TMPL_CONF_DIR="$PGMODELER_ROOT/conf" export PGMODELER_SCHEMAS_DIR="$PGMODELER_ROOT/schemas"