#!/bin/sh

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

java -jar "$INSTALLATION_DIR/lib/co.codewizards.cloudstore.client-0.10.1.jar" "$@"

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