2018-05-06 19:25:56 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-05-07 17:14:59 +02:00
|
|
|
"runtime"
|
2018-05-06 19:25:56 +02:00
|
|
|
"os"
|
2018-05-07 17:14:59 +02:00
|
|
|
"github.com/dballard/markdown-bullet-journal/process"
|
2018-05-06 19:25:56 +02:00
|
|
|
)
|
|
|
|
|
2018-05-07 17:14:59 +02:00
|
|
|
type processHandler struct {
|
|
|
|
File *os.File
|
2018-05-06 19:25:56 +02:00
|
|
|
}
|
|
|
|
|
2018-05-07 17:14:59 +02:00
|
|
|
func (ph *processHandler) Writeln(line string) {
|
|
|
|
ph.File.WriteString(line + "\n")
|
|
|
|
}
|
2018-05-06 19:25:56 +02:00
|
|
|
|
2018-05-07 17:14:59 +02:00
|
|
|
func main() {
|
|
|
|
ph := new(processHandler)
|
2018-05-06 19:25:56 +02:00
|
|
|
|
2018-05-07 17:14:59 +02:00
|
|
|
if runtime.GOOS == "windows" {
|
2018-05-06 19:25:56 +02:00
|
|
|
|
2018-05-07 17:14:59 +02:00
|
|
|
} else {
|
|
|
|
ph.File = os.Stdout
|
2018-05-06 19:25:56 +02:00
|
|
|
}
|
|
|
|
|
2018-05-07 17:14:59 +02:00
|
|
|
files := process.GetFiles()
|
|
|
|
for _, file := range files {
|
|
|
|
ph.Writeln("")
|
|
|
|
ph.Writeln(file)
|
|
|
|
process.ProcessFile(ph, file)
|
2018-05-06 19:25:56 +02:00
|
|
|
}
|
|
|
|
}
|