Skip to content

Commit

Permalink
base64 command works differently in MacOS vs. Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoddard committed Aug 14, 2024
1 parent ef9a315 commit 60267c9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions search_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
. ./env.sh

max_results="${MAX_RESULTS:-4}"
rerank="${RERANK:-regex}"

os=$( uname -o )
base64="base64"
if [[ $os == *"Linux"* ]]
then
base64="$base64 -w 0"
fi

if [ $# -lt 1 ]
then
echo "Usage: $0 word [word2 ... wordN]"
exit 1
fi

echo "rerank: $rerank"

curl -s http://$FLASK_HOST:$FLASK_PORT/search/$( echo -n "$@" | base64 )/$max_results/$rerank | jq
curl -s http://$FLASK_HOST:$FLASK_PORT/search/$( echo -n "$@" | $base64 )/$max_results | jq

0 comments on commit 60267c9

Please sign in to comment.