From 8496faeae4abd065cace7be91c01bf9aba550c45 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 3 Nov 2014 21:35:09 +0100 Subject: [PATCH] Not hardcoding bashscript config location #398 --- .../sbt/packager/archetypes/JavaServerApplication.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala index a7c8e5528..2f4c8d1aa 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala @@ -62,9 +62,10 @@ object JavaServerAppPackaging extends AutoPlugin { }, makeEtcDefault <<= (packageName in Linux, target in Universal, linuxEtcDefaultTemplate, linuxScriptReplacements) map makeEtcDefaultScript, - linuxPackageMappings <++= (makeEtcDefault, packageName in Linux) map { (conf, name) => - conf.map(c => LinuxPackageMapping(Seq(c -> ("/etc/default/" + name)), - LinuxFileMetaData(Users.Root, Users.Root, "644")).withConfig()).toSeq + linuxPackageMappings <++= (makeEtcDefault, bashScriptConfigLocation) map { (conf, configLocation) => + configLocation.flatMap { path => + conf.map(c => LinuxPackageMapping(Seq(c -> path), LinuxFileMetaData(Users.Root, Users.Root, "644")).withConfig()) + }.toSeq }, // === /var/run/app pid folder ===