Skip to content

Commit

Permalink
Merge pull request #97 from kardapoltsev/wip/user-defined-scripts
Browse files Browse the repository at this point in the history
Fixed: user defined scripts in debian overridden by generated files
  • Loading branch information
jsuereth committed Dec 4, 2013
2 parents 61e8b64 + 10b87ec commit fbbcd9a
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 fbbcd9a

Please sign in to comment.