]> Untitled Git - lemmy.git/blob - install.sh
Add a semicolon.
[lemmy.git] / install.sh
1 #!/bin/bash
2 set -e
3
4 # Set the database variable to the default first.
5 # Don't forget to change this string to your actual database parameters
6 # if you don't plan to initialize the database in this script.
7 export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
8
9 # Set other environment variables
10 export JWT_SECRET=changeme
11 export HOSTNAME=rrr
12
13 # Optionally initialize the database
14 init_db_valid=0
15 init_db_final=0
16 while [ "$init_db_valid" == 0 ]
17 do
18   read -p "Initialize database (y/n)? " init_db
19   case "${init_db,,}" in 
20     y|yes ) init_db_valid=1; init_db_final=1;;
21     n|no ) init_db_valid=1; init_db_final=0;;
22     * ) echo "Invalid input" 1>&2;;
23   esac
24 done
25 if [ "$init_db_final" = 1 ]
26 then
27   source ./server/db-init.sh
28   read -n 1 -s -r -p "Press ANY KEY to continue execution of this script, press CTRL+C to quit..."
29 fi
30
31 # Build the web client
32 cd ui
33 yarn
34 yarn build
35
36 # Build and run the backend
37 cd ../server
38 cargo run
39
40 # For live coding, where both the front and back end, automagically reload on any save, do:
41 # cd ui && yarn start
42 # cd server && cargo watch -x run