diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-15 18:26:36 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-21 18:28:00 +0100 |
| commit | a97c3c40c33b4b11591c33aa0c2fd8f6d5b23e9d (patch) | |
| tree | 6338a1e29a9b345dff53cc5b710fe576e20558d8 /internal | |
| parent | 35aa646c476c62b11377e25ac0b20e5054e2c5da (diff) | |
FSM: Do not exec mmdc for mermaid
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/fsm/fsm.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/internal/fsm/fsm.go b/internal/fsm/fsm.go index b6048be..84b5f1b 100644 --- a/internal/fsm/fsm.go +++ b/internal/fsm/fsm.go @@ -5,7 +5,6 @@ package fsm import ( "fmt" "os" - "os/exec" "path" "sort" @@ -115,7 +114,6 @@ func (fsm *FSM) graphFilename(extension string) string { func (fsm *FSM) writeGraph() { gph := fsm.GenerateGraph() gf := fsm.graphFilename(".graph") - gif := fsm.graphFilename(".png") f, err := os.Create(gf) if err != nil { return @@ -124,12 +122,9 @@ func (fsm *FSM) writeGraph() { _ = f.Close() }() - _, err = f.WriteString(gph) - if err != nil { - cmd := exec.Command("mmdc", "-i", gf, "-o", gif, "--scale", "4") - // Generating is best effort - _ = cmd.Start() - } + // Writing the graph is best effort + // TODO: Return string instead, we do not want to write files in this library + _, _ = f.WriteString(gph) } // GoTransitionRequired transitions the state machine to a new state with associated state data 'data' |
