#!/bin/sh
# Copyright 2008-2017 Dropbox, Inc.
#
# Environment script for the `dropbox` executable. Should be idempotent.
PAR=$(dirname "$(readlink -f "$0")")

# Make sure `LD_LIBRARY_PATH` is not affected when we launch a subprocess.
if [ -z "$OLD_LD_LIBRARY_PATH" ]; then
    OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
    export OLD_LD_LIBRARY_PATH
fi

# Select an entry point.
entry_point="dropbox"
if [ "$1" = "/py3" ] || [ $DB_USE_PY3 ]; then
    entry_point="dropbox_py3"
fi

export QT_PLUGIN_PATH=
exec "$PAR/$entry_point" "$@"
