irongit
rango/dev
36 lines736 B
1#!/bin/bash
2# For development only
3
4# if venv doesn't exist, create it
5if [ ! -d "venv" ]; then
6 python -m venv venv
7fi
8
9# if venv is not activated, activate it
10if [ -z "$VIRTUAL_ENV" ]; then
11 source venv/Scripts/activate
12fi
13
14# if first arg is back, build frontend and run backend
15if [ "$1" = "back" ]; then
16 # build the frontend
17 cd rango/frontend
18 npm run build
19 cd ..
20
21 # create secret key
22 cd backend
23 python manage.py createsecret
24
25 # migrate database
26 python manage.py migrate
27
28 # run backend development server
29 python manage.py runserver & cd ../..
30fi
31
32# if first arg is front, run frontend development server
33if [ "$1" = "front" ]; then
34 cd rango/frontend
35 npm run dev & cd ../..
36fi