From fd3610451aa7c237e06f3e74bc93c3b6c079ce24 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Wed, 13 Apr 2016 19:30:54 +0200 Subject: [PATCH] Adds the compilation process for PDF files --- compiler/compile.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/compile.go b/compiler/compile.go index 9ca1826..a003e15 100644 --- a/compiler/compile.go +++ b/compiler/compile.go @@ -41,7 +41,17 @@ func CompileDir(path string, opts *settings.Settings) { if !helpers.Exists(scores[i].OutputPath) || scores[i].LastModified.After(helpers.LastModified(scores[i].OutputPath)) { - msg, err := Lilypond(scores[i].Path) + var ( + msg string + err error + ) + switch filepath.Ext(scores[i].Path){ + case ".ly": + msg, err = Lilypond(scores[i].Path) + case ".pdf": + err = os.Link(scores[i].Path, scores[i].OutputPath) + } + if err != nil { log.WithFields(log.Fields{ "message": msg,