Skip to content
Snippets Groups Projects
Commit 2cea4835 authored by rxd's avatar rxd
Browse files

script file implemented.

parent f5ae9109
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Stop on errors, print commands
# See https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -Eeuo pipefail
set -x
# Sanity check command line options
usage() {
echo "Usage: $0 (start|stop|init)"
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
# Parse argument. $1 is the first argument
echo $1
case $1 in
"start")
source env/bin/activate
export FLASK_ENV=development
export FLASK_APP=MemeGenerator
flask run --host 0.0.0.0 --port 8000
;;
"stop")
pkill -f "flask run --host 0.0.0.0 --port 8000" || true
;;
"init")
set +o pipefail
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
pip install -e .
;;
*)
usage
exit 1
;;
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment