Skip to content

Instantly share code, notes, and snippets.

@nathanic
Last active December 12, 2015 07:48
Show Gist options
  • Save nathanic/4739297 to your computer and use it in GitHub Desktop.
Save nathanic/4739297 to your computer and use it in GitHub Desktop.
simple script to detect and run the latest h2 server
#!/bin/sh
# find and run the latest version of h2 in the local maven repo
H2VERSION=$(ls ~/.m2/repository/com/h2database/h2/ | grep '^[.0-9]*$' | tail -n 1)
if [[ -z "$H2VERSION" ]]; then
echo "NOPE: I can't find any h2 jars installed in your maven repo."
else
echo detected H2 version is $H2VERSION.
java -cp ~/.m2/repository/com/h2database/h2/${H2VERSION}/h2-${H2VERSION}.jar org.h2.tools.Server $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment