Skip to content

Commit

Permalink
task: make install script cache aware
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominick Leppich committed Nov 29, 2024
1 parent 41d56e3 commit 7da236f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ if [ ! -e $SAMPLE_PATH ]; then
fi
CACHE_FILE="$SAMPLE_PATH/cache.txt"

if [ -f "$CACHE_FILE" ]; then
while true; do
read -n 1 -s -p "An existing import cache was found, do you want to install from scratch? [Y]es|[N]o " answer
case $answer in
y|Y)
rm "$CACHE_FILE"
break
;;
n|N)
break
;;
*)
echo -e "\nInvalid choice!"
;;
esac
done
echo ""
fi

curl_call() {
curl --location "$HOST:$PORT/api/v1/$1" \
--header 'Content-Type: application/json' \
Expand All @@ -58,6 +77,10 @@ curl_file_upload_call() {
}

for INSTALL_DIR in $(ls $SAMPLE_PATH); do
if [ "$INSTALL_DIR" == "cache.txt" ]; then
continue
fi

ENDPOINT=$(echo $INSTALL_DIR | cut -d'_' -f2)
echo "Installing $ENDPOINT"
for ITEM in $(ls $SAMPLE_PATH/$INSTALL_DIR | grep ".json"); do
Expand Down

0 comments on commit 7da236f

Please sign in to comment.