From 28b1c5b5dad2ca952efb90f11ebbffe47019fd1e Mon Sep 17 00:00:00 2001 From: mrfry Date: Sat, 8 Apr 2023 18:41:01 +0200 Subject: [PATCH] even more setup script improvements --- scripts/setup.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index ec5fdbd..7f8fb58 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -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 # ------------------------------------------------------------------------------------