-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor change to contrib/usql-test.sh
- Loading branch information
Showing
1 changed file
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |