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 # ------------------------------------------------------------------------------------