このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
whoogle-mod/whoogle-search
Ben Busby 130ac4532e Refactored handling of user config
Now implemented as a flask global variable reads from the same json file
as before, but doesn't crash if it does not find an existing file.

Removed user config creation from run script
2020-05-06 18:39:12 -06:00

28 行
577 B
Bash
実行ファイル

#!/bin/bash
# Usage:
# ./whoogle-search # Runs the full web app
# ./whoogle-search test # Runs the testing suite
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
# Set default port if unavailable
if [[ -z "${PORT}" ]]; then
PORT=5000
fi
# Set directory to serve static content from
[[ ! -z $1 ]] && SUBDIR="$1" || SUBDIR="app"
export APP_ROOT=$SCRIPT_DIR/$SUBDIR
export STATIC_FOLDER=$APP_ROOT/static
mkdir -p $STATIC_FOLDER
pkill flask
# Check for regular vs test run
if [[ $SUBDIR == "test" ]]; then
pytest -sv
else
flask run --host="0.0.0.0" --port=$PORT
fi