Compare commits

...

3 Commits

Author SHA1 Message Date
Chris Sexton 94065c21ad add packr and clean to makefile 2020-04-23 11:48:44 -04:00
Chris Sexton b00bef7da4 ignore packr files 2020-04-23 11:46:44 -04:00
Chris Sexton 20595a7d7f not sure why, but linkchecker is a var now 2020-04-23 11:46:18 -04:00
3 changed files with 11 additions and 6 deletions

2
.gitignore vendored
View File

@ -205,3 +205,5 @@ example
*.adoc *.adoc
tpsemester tpsemester
semestergen semestergen
main-packr.go
packrd

View File

@ -1,5 +1,10 @@
build: gendates.go
packr2 build
run: build *.adoc.tpl c311.toml run: build *.adoc.tpl c311.toml
./semestergen c311.toml ./semestergen c311.toml
build: gendates.go clean:
go build @rm -rf packrd main-packr.go semestergen
.PHONY: clean

View File

@ -24,8 +24,6 @@ var tplMap = map[string]string{
"course": "course.task.tpl", "course": "course.task.tpl",
} }
var linkChecker = mkLinkChecker()
type DayMap map[int]time.Time type DayMap map[int]time.Time
type Eval struct { type Eval struct {
@ -221,7 +219,7 @@ func writeSyllabus(c Config) error {
return err return err
} }
func mkLinkChecker() func(Link) Link { var linkChecker = func() func(Link) Link {
ids := map[string]bool{} ids := map[string]bool{}
return func(l Link) Link { return func(l Link) Link {
if !ids[l.Title] { if !ids[l.Title] {
@ -243,7 +241,7 @@ func mkLinkChecker() func(Link) Link {
return l return l
} }
} }()
func mkConfig(path string) Config { func mkConfig(path string) Config {
var c Config var c Config