diff --git a/changelog.md b/changelog.md index 02ef4ae..e049494 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (after version 0.0.5). +## [0.2.1] - 2022-06-03 +### Fixed +- Embed the template file into the binary ([Issue #10](https://github.com/KarnerTh/mermerd/issues/10)) + + ## [0.2.0] - 2022-06-01 ### Added - A `--debug` flag/config to show debug information @@ -66,6 +71,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (after version 0.0 ### Added - Initial release of mermerd +[0.2.1]: https://github.com/KarnerTh/mermerd/releases/tag/v0.2.1 + [0.2.0]: https://github.com/KarnerTh/mermerd/releases/tag/v0.2.0 [0.1.0]: https://github.com/KarnerTh/mermerd/releases/tag/v0.1.0 diff --git a/diagram/diagram.go b/diagram/diagram.go index c8442bf..87db37a 100644 --- a/diagram/diagram.go +++ b/diagram/diagram.go @@ -1,6 +1,7 @@ package diagram import ( + _ "embed" "os" "text/template" @@ -10,6 +11,9 @@ import ( "github.com/KarnerTh/mermerd/database" ) +//go:embed erd_template.gommd +var erdTemplate string + type diagram struct { config config.MermerdConfig } @@ -31,7 +35,7 @@ func (d diagram) Create(result *database.Result) error { defer f.Close() - tmpl, err := template.ParseFiles("diagram/erd_template.gommd") + tmpl, err := template.New("erd_template").Parse(erdTemplate) if err != nil { logrus.Error("Could not load template file", " | ", err) return err