From 9fb30c8a580778aaa04bf1a32815ec79c3d63c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ku=C5=BE=C3=ADlek?= Date: Tue, 3 Mar 2020 15:25:08 +0100 Subject: [PATCH] Yeet init.sh --- init.sh | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/init.sh b/init.sh index 39f9278..1b752cf 100644 --- a/init.sh +++ b/init.sh @@ -1,9 +1,30 @@ -#!/bin/sh +#!/bin/bash +export FLASK_APP=yadc +root="." -mkdir -p instance -mkdir -p instance/post/img -mkdir -p instance/post/jpeg -mkdir -p instance/post/sample -mkdir -p instance/post/thumb +createdirs() { + mkdir -p instance + mkdir -p instance/post/img + mkdir -p instance/post/jpeg + mkdir -p instance/post/sample + mkdir -p instance/post/thumb +} +prepare_instance() { + python3 -m pipenv install -cp yadc/config.def.py instance/config.py \ No newline at end of file + createdirs + cp yadc/config.def.py instance/config.py +} + +prepare_db() { + python3 -m pipenv run flask upgrade +} + +case $1 in + "instance"|"") + prepare_instance + ;; + "db") + prepare_db + ;; +esac \ No newline at end of file