From 9826aa214393e5821a2c0d9035185a8a871cf5e7 Mon Sep 17 00:00:00 2001 From: Niklas Fasching Date: Tue, 11 Dec 2018 14:46:26 +0100 Subject: [PATCH] Add make target to automatically regenerate html fixtures After changing something the fixtures need to be updated to reflect the new output. This just moves those steps from my bash history to make. --- Makefile | 4 ++++ etc/generate-html-fixtures | 5 +++++ main.go | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 etc/generate-html-fixtures diff --git a/Makefile b/Makefile index b91089d..58aea64 100644 --- a/Makefile +++ b/Makefile @@ -25,3 +25,7 @@ render: .PHONY: generate-gh-pages generate-gh-pages: build ./etc/generate-gh-pages + +.PHONY: generate-html-fixtures +generate-html-fixtures: build + ./etc/generate-html-fixtures diff --git a/etc/generate-html-fixtures b/etc/generate-html-fixtures new file mode 100755 index 0000000..af1fbeb --- /dev/null +++ b/etc/generate-html-fixtures @@ -0,0 +1,5 @@ +#!/bin/bash + +for org_file in org/testdata/*.org; do + ./go-org $org_file html > org/testdata/$(basename $org_file .org).html +done diff --git a/main.go b/main.go index 751dadb..22e229b 100644 --- a/main.go +++ b/main.go @@ -38,7 +38,7 @@ func main() { default: log.Fatal("Unsupported output format") } - log.Println(out) + log.Print(out) } func highlightCodeBlock(source, lang string) string {