#!/bin/bash echo amount of arguments: $# if [[ $# -ne 4 ]]; then echo "Build script has to be called with exactly two arguments." echo "The version number (Major.Minor.Patch) as its first argument." echo "... and the OS (linux, windows or macos) as the second argument" echo "TODO: DOCUMENT ARGUMENTS 3 & 4!!!" echo "Aborting..." exit 1 fi VERSION=$1 regex='^([0-9]+\.){0,2}(\*|[0-9]+)$' if [[ $VERSION =~ $regex ]]; then echo "Version accepted: $VERSION" else echo "Version '$VERSION' is not acceptable. Aborting..." exit 1 fi PLATFORM=$2 # TODO refactor this to use something like PLATFORMS.contains(PLATFORM) if [[ $PLATFORM == linux ]]; then echo "OS: $PLATFORM" elif [[ $PLATFORM == windows ]]; then echo "OS: $PLATFORM" elif [[ $PLATFORM == macos ]]; then echo "OS: $PLATFORM" else echo "Platform '$PLATFORM' is not acceptable. Aborting..." exit 1 fi #if [[ ! -e .env ]]; then # echo "File .env not found. Aborting..." # exit 1 #fi #echo "Sourcing .env file..." #source .env echo "calling the compile-executable.sh..." ./compile-executable.sh $1 $2 $3 $4 echo "calling the create-installer.sh..." ./create-installer.sh $1 $2 $3 $4 echo "calling the deployToRepo.sh..." ./deployToRepo.sh $1 $2 $3 $4 cd ${OLD_PWD}