bbj/setup.sh

28 lines
429 B
Bash
Raw Normal View History

2017-04-02 07:35:58 +00:00
#!/bin/bash
set -e
if [[ $1 == --init ]]; then
sqlite3 data.sqlite < schema.sql
2017-04-02 07:35:58 +00:00
echo cleared
exit
fi
DEPS=(
cherrypy
markdown
)
if [[ -z $1 ]]; then
cat << EOF
Pass the python interpreter to use for pip installation
(either a venv or a system interpreter)
EOF
exit
fi
$1 -m pip install ${DEPS[*]}
echo "Enter [i] to initialize a new database"
read CLEAR
[[ $CLEAR == "i" ]] && sqlite3 bbj.db < schema.sql