Skip to content

Commit

Permalink
Minor change to contrib/usql-test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Mar 28, 2024
1 parent fcc3fd6 commit e0aa55c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions contrib/usql-test.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
#!/bin/bash

SRC=$(realpath $(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
SRC=$(realpath $(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd))

USQL=$(which usql)
if [ -f $SRC/../usql ]; then
USQL=$(realpath $SRC/../usql)
fi

export USQL_SHOW_HOST_INFORMATION=false
for TARGET in $SRC/*/usql-config; do
NAME=$(basename $(dirname $TARGET))
if [[ ! -z "$(podman ps -q --filter "name=$NAME")" || "$NAME" == "duckdb" || "$NAME" == "sqlite3" ]]; then
unset DB VSQL
source $TARGET
if [ -z "$DB" ]; then
echo "error: DB not defined in $TARGET/usql-config!"
exit 1
fi
if [ -z "$VSQL" ]; then
echo "error: VSQL not defined in $TARGET/usql-config!"
exit 1
if [[ -z "$DB" || -z "$VSQL" ]]; then
echo -e "ERROR: DB or VSQL not defined in $TARGET!\n"
continue
fi
(set -x;
USQL_SHOW_HOST_INFORMATION=false \
$USQL "$DB" -X -J -c "$VSQL"
$USQL "$DB" -X -J -c "$VSQL"
)
echo
fi
done

0 comments on commit e0aa55c

Please sign in to comment.