Adds the initial code for the compile command
This commit is contained in:
parent
dbb5c0b0e4
commit
214a57cdfb
@ -15,8 +15,11 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/jjdekker/ponder/compiler"
|
||||
"github.com/jjdekker/ponder/helpers"
|
||||
"github.com/jjdekker/ponder/settings"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@ -29,8 +32,14 @@ lilypond files in accordance to ponder settings file.
|
||||
Files that have already been compiled will be skipped,
|
||||
unless the lilypond file has been edited.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
// TODO: Work your own magic here
|
||||
fmt.Println("compile called")
|
||||
// Find and Unmarshal the settings file
|
||||
path, err := helpers.FindFileDir(settingsFile)
|
||||
helpers.Check(err, "unable to find library directory")
|
||||
opts, err := settings.FromFile(filepath.Join(path, settingsFile))
|
||||
helpers.Check(err, "unable to parse settings file")
|
||||
|
||||
// Compile files
|
||||
compiler.CompileDir(path, opts)
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@ package compiler
|
||||
|
||||
import "github.com/jjdekker/ponder/settings"
|
||||
|
||||
func compileDir(path string, opts *settings.Settings) {
|
||||
// CompileDir compiles all lilypond files and makes all
|
||||
// sheet music available in the OutputDir
|
||||
func CompileDir(path string, opts *settings.Settings) {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user