aboutsummaryrefslogtreecommitdiffstats
path: root/setup.sh
diff options
context:
space:
mode:
authorBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-02 09:53:55 -0500
committerBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-02 09:53:55 -0500
commit474f13842b187fe54d20b770a10a7885985759f2 (patch)
tree1506c21a99df5c42923a2feb859275c9caa70d87 /setup.sh
parent3640d1b1dedaa934d3d2e52b582d71ef16e31324 (diff)
downloadbbj-474f13842b187fe54d20b770a10a7885985759f2.tar.gz
fuck commit messages
Diffstat (limited to 'setup.sh')
-rwxr-xr-xsetup.sh36
1 files changed, 21 insertions, 15 deletions
diff --git a/setup.sh b/setup.sh
index 024290c..5f83919 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,27 +1,33 @@
#!/bin/bash
-set -e
-
-if [[ $1 == --init ]]; then
- sqlite3 data.sqlite < schema.sql
- 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
+case $1 in
+ --help )
+ cat <<EOF
+This script initializes the deps and files for bbj and also sets up its database.
+It takes the following flags:
+ --help to print this
+ --dbset only runs the sql script
-$1 -m pip install ${DEPS[*]}
+You can optionally pass a different python interpreter to use (such as
+a virtual environment), with no arguments this will use the system python3
+EOF
+ exit;;
+ --dbset )
+ sqlite3 data.sqlite < schema.sql
+ echo cleared
+ exit;;
+esac
+PYTHON=`which python3`
+[[ -e logs ]] || mkdir logs; mkdir logs/exceptions
+[[ -z $1 ]] || PYTHON=$1
+echo Using $PYTHON...
+$PYTHON -m pip install ${DEPS[*]}
echo "Enter [i] to initialize a new database"
read CLEAR
[[ $CLEAR == "i" ]] && sqlite3 bbj.db < schema.sql
Un proyecto texto-plano.xyz