From a0375195d49cb4d96036728996d9ae30ae08c526 Mon Sep 17 00:00:00 2001 From: pkaczor Date: Sun, 29 Nov 2015 14:23:54 +0100 Subject: [PATCH] FIX #702, pass arguments loaded from script conf file --- .../typesafe/sbt/packager/archetypes/ash-template | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/resources/com/typesafe/sbt/packager/archetypes/ash-template b/src/main/resources/com/typesafe/sbt/packager/archetypes/ash-template index 80eaa4635..9dc4794ce 100644 --- a/src/main/resources/com/typesafe/sbt/packager/archetypes/ash-template +++ b/src/main/resources/com/typesafe/sbt/packager/archetypes/ash-template @@ -27,10 +27,21 @@ realpath () { ) } +# Loads a configuration file full of default command line options for this script. +loadConfigFile() { + cat "$1" | sed '/^\#/d' +} + + real_script_path="$(realpath "$0")" app_home="$(realpath "$(dirname "$real_script_path")")" lib_dir="$(realpath "${app_home}/../lib")" ${{template_declares}} -java -classpath $app_classpath $app_mainclass $@ +# if configuration files exist, prepend their contents to $@ so it can be processed by this runner +[ -f "$script_conf_file" ] && set -- $(loadConfigFile "$script_conf_file") "$@" + +java -classpath $app_classpath "$@" $app_mainclass + +