Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created April 29, 2020 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sciss/0765fc2b111e3bcb2fdb11ca36ec6d7b to your computer and use it in GitHub Desktop.
Save Sciss/0765fc2b111e3bcb2fdb11ca36ec6d7b to your computer and use it in GitHub Desktop.
val mainSq = (userHome / "Downloads" / "rb").children(f => f.extL == "pdf" && f.base.startsWith("p-")).sorted(File.NameOrdering)
mainSq.foreach(f => println(f.base))
def runMain(): Unit = {
val out = userHome / "Downloads" / "rb" / "main.pdf"
require (!out.exists())
import scala.sys.process._
val cmd = Seq("pdftk") ++ mainSq.map(_.path) ++ Seq("cat", "output", out.path)
val code: Int = cmd.!
require (code == 0)
}
runMain()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment