2013-06-26 03:10:48 +00:00
|
|
|
#!/bin/sh
|
2012-09-26 20:02:27 +00:00
|
|
|
|
2013-06-26 03:10:48 +00:00
|
|
|
SCRIPT="$0"
|
|
|
|
|
|
|
|
while [ -h "$SCRIPT" ] ; do
|
|
|
|
ls=`ls -ld "$SCRIPT"`
|
|
|
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
|
|
if expr "$link" : '/.*' > /dev/null; then
|
|
|
|
SCRIPT="$link"
|
|
|
|
else
|
|
|
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ! -d "${APP_DIR}" ]; then
|
|
|
|
APP_DIR=`dirname "$SCRIPT"`/..
|
|
|
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $APP_DIR
|
|
|
|
|
|
|
|
|
|
|
|
# if you've executed sbt assembly previously it will use that instead.
|
2012-12-04 15:08:35 +00:00
|
|
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
2013-06-26 03:10:48 +00:00
|
|
|
ags="$@ samples/client/petstore/ruby/RubyPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key"
|
|
|
|
|
|
|
|
if [ -f $APP_DIR/target/swagger-codegen.jar ]; then
|
|
|
|
scala -cp target/swagger-codegen.jar $ags
|
|
|
|
elif [[ -f $APP_DIR/target/scala-2.10/swagger-codegen.jar ]]; then
|
|
|
|
scala -cp target/scala-2.10/swagger-codegen.jar $ags
|
|
|
|
else
|
|
|
|
./sbt assembly
|
|
|
|
scala -cp target/swagger-codegen.jar $ags
|
|
|
|
fi
|
|
|
|
|