#!/bin/bash
# This script runs the JSONLDPlayground code.
# Before running this script for the first time 
# you may need to run:
#     chmod +x jsonldplayground
#
# run ./jsonldplayground for the usage

TOP=$(dirname $0)

if [ ! -d "${TOP}/target/appassembler/bin" ]; then
    echo -e "Building with maven... (This could fail if you haven't previously run 'mvn install' on jsonld-java)\n">&2
    (cd "${TOP}"; mvn -quiet clean install -DskipTests)
fi

chmod u+x "${TOP}/target/appassembler/bin"/*
"${TOP}/target/appassembler/bin/jsonldplayground" "$@"
