even more setup script improvements

This commit is contained in:
mrfry 2023-04-08 18:41:01 +02:00
parent bd848c843f
commit 28b1c5b5da

View file

@ -1,6 +1,7 @@
#!/bin/bash
baseDir=$(pwd)
domainPath="./data/domain"
hr() { [ -t 0 ] && printf '\033[0;32m%*s\033[0m\n' "$(tput cols)" '' | tr ' ' '='; }
@ -30,16 +31,17 @@ makeNextSubmodule() {
}
# ------------------------------------------------------------------------------------
# Git submodules
# Checking if we are ready to go
# ------------------------------------------------------------------------------------
log 'Updating / Cloning project'
checkFile "$PWD/src/server.ts"
checkFile "$PWD/package.json"
checkFile "$PWD/package-lock.json"
git pull || exit
git submodule update --init --recursive || exit
if [ ! -f "${domainPath}" ]; then
echo -e "\033[0;41m${domainPath} does not exist!\033[0m"
echo "Please create it, and re-run this script."
echo "Expected content: domain, ex.:'frylabs.net' (without http:// and /)"
exit
fi
# ------------------------------------------------------------------------------------
# Creating directory structure
@ -55,6 +57,13 @@ mkdir -p publicDirs/qminingPublic
touch publicDirs/qminingPublic/motd
# ------------------------------------------------------------------------------------
# Git submodules
# ------------------------------------------------------------------------------------
log 'Updating / Cloning project'
git pull || exit
git submodule update --init --recursive || exit
# ------------------------------------------------------------------------------------
# DB-s
# ------------------------------------------------------------------------------------