Skip to content

Commit

Permalink
fallback to previous directory
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Aug 31, 2022
1 parent 093c840 commit 500af93
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions bin/pulsar
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,20 @@ fi
# find pulsar sql trino distribution location
check_trino_libraries() {
if [ ! -d "${TRINO_HOME}" ]; then
BUILT_TRINO_HOME="${SQL_HOME}/presto-distribution/target/pulsar-presto-distribution"
if [ ! -d "${BUILT_TRINO_HOME}" ]; then
echo "\nCouldn't find trino distribution.";
echo "Make sure you've run 'mvn package'\n";
exit 1;
# TODO: Refactor when we drop this backward compatibility.
FALLBACK_PRESTO_HOME="${PULSAR_HOME}/lib/presto"
if [ ! -d "${FALLBACK_PRESTO_HOME}" ]; then
BUILT_TRINO_HOME="${SQL_HOME}/presto-distribution/target/pulsar-presto-distribution"
if [ ! -d "${BUILT_TRINO_HOME}" ]; then
echo "\nCouldn't find trino distribution.";
echo "Make sure you've run 'mvn package'\n";
exit 1;
fi
TRINO_HOME=${BUILT_TRINO_HOME}
PULSAR_TRINO_CONF=${BUILT_TRINO_HOME}/conf
else
TRINO_HOME=${FALLBACK_PRESTO_HOME}
fi
TRINO_HOME=${BUILT_TRINO_HOME}
PULSAR_TRINO_CONF=${BUILT_TRINO_HOME}/conf
fi
}

Expand Down Expand Up @@ -259,6 +265,10 @@ fi

if [ -z "$PULSAR_TRINO_CONF" ]; then
PULSAR_TRINO_CONF=$DEFAULT_PULSAR_TRINO_CONF
# TODO: Refactor to remove when we drop this backward compatibility.
if [ ! -d "${PULSAR_TRINO_CONF}" ]; then
FALLBACK_PULSAR_PRESTO_CONF=${PULSAR_HOME}/conf/presto
fi
fi

if [ -z "$FUNCTIONS_LOG_CONF"]; then
Expand Down

0 comments on commit 500af93

Please sign in to comment.