Skip to content

Commit

Permalink
Fix #6 Implement packageDirectoryAndContentsMapping feature
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 committed Dec 14, 2013
1 parent 00b4942 commit a41d5e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ trait LinuxPlugin extends Plugin {
*/
def packageTemplateMapping(files: String*)(dir: File = new File(sys.props("java.io.tmpdir"))) = LinuxPackageMapping(files map ((dir, _)))

/**
* This method skips directories. So empty directories
* don't appear in the mapping
* @param dirs - directories to map
*/
def packageDirectoryAndContentsMapping(dirs: (File, String)*) = LinuxPackageMapping(
for {
(src, dest) <- dirs
path <- (src ***).get
if !path.isDirectory
} yield path -> path.toString.replaceFirst(src.toString, dest))

// TODO - we'd like a set of conventions to take universal mappings and create linux package mappings.

/** Create a ascii friendly string for a man page. */
Expand Down

0 comments on commit a41d5e3

Please sign in to comment.