#!/bin/sh

BIN_DIR=`dirname $0`
INSTALLATION_DIR="$BIN_DIR/.."
UPDATER_DIR="$INSTALLATION_DIR/updater"

java -jar "$INSTALLATION_DIR/lib/co.codewizards.cloudstore.server-0.10.8-SNAPSHOT.jar" "$@"

if [ -d "$UPDATER_DIR" ]; then
	echo "Updating CloudStore..."
	java -jar "$UPDATER_DIR/lib/co.codewizards.cloudstore.updater-0.10.8-SNAPSHOT.jar" -installationDir "$INSTALLATION_DIR"
	"$0" "$@"
fi
