Files
hub/run.sh
T

56 lines
1.1 KiB
Bash

#!/bin/bash
case "$1" in
"")
cd backend
source ../.venv/bin/activate
python app.py
;;
"test")
# Setup test data directory
mkdir -p test-data
rm -f test-data/horde.db
# Start backend in the background
cd backend
source ../.venv/bin/activate
python app.py ../test-data &
BACKEND_PID=$!
echo "Started backend: $BACKEND_PID"
sleep 2
# Run tests
cd ../testing
bash signup.sh
#node login.js
node suite.js
# Finalize the backend server
kill $BACKEND_PID
;;
"debug")
# Debug doesn't work very well... I don't use it.
cd backend
source ../.venv/bin/activate
python app.py &
cd ../frontend
# This can be skipped if chrome IS installed
export CHROME_EXECUTABLE=chromium
export BACKEND_URL="ws://localhost:5000"
flutter run -d chrome
# Close backend when debugger closes
kill $!
;;
"watch")
# requires 'inotify-tools' package
cd frontend
while inotifywait -r -e modify,create,delete lib; do
flutter build web
done
;;
*)
echo "Error: unknown command '$1'"
;;
esac