#!/usr/bin/env bash

function jbServer() {
    if [ "$1" == "--debug" ]; then
      shift
      build/install/jb-ssg-site-server/bin/JbServer \
        -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:8192 "$@"
    else
      build/install/jb-ssg-site-server/bin/JbServer "$@"
    fi
}

./gradlew -q installServerDist && jbServer
