#!/bin/bash

set -e

cd `dirname $0`

mkdir -p /usr/local/bin

cat >/usr/local/bin/luan <<End
#!/bin/bash

LUAN=$(pwd)

for i in \$LUAN/jars/* ; do CLASSPATH=\$CLASSPATH:\$i ; done
CLASSPATH=\$(echo -n \$CLASSPATH | sed 's/^://')

java -classpath \$CLASSPATH luan.Luan "\$@"
End

chmod +x /usr/local/bin/luan

echo "the command 'luan' has been installed"
