#!/bin/bash

set -e

# Check if the jar has been built.
if [ ! -e target/wallet-tool.jar ] || [[ "$ALWAYS_BUILD_WALLETTOOL" != "" ]]; then
  echo "Compiling WalletTool to a JAR"
  cd ..
  mvn package -DskipTests
  cd tools
fi

java -jar target/wallet-tool.jar "$@"
