Skip to content

Commit

Permalink
Fixed: user defined scripts in debian overridden by generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
kardapoltsev committed Dec 2, 2013
1 parent fe7387a commit 0f1e0c7
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin {

private[this] def scriptMapping(scriptName: String)(script: Option[File], controlDir: File): Seq[(File, String)] = {
(script, controlDir) match {
case (Some(script), _) => Seq(script -> scriptName)
case (None, dir) =>
val script = dir / scriptName
if (script exists) Seq(file(script getAbsolutePath) -> scriptName) else Seq.empty
// check if user defined script exists
case (_, dir) if (dir / scriptName).exists =>
Seq(file(dir / scriptName getAbsolutePath) -> scriptName)
// create mappings for generated script
case (scr, _) => scr.toSeq.map(_ -> scriptName)
}
}


def debianSettings: Seq[Setting[_]] = Seq(
debianPriority := "optional",
debianSection := "java",
Expand Down

0 comments on commit 0f1e0c7

Please sign in to comment.