Skip to content

Commit 713de2d

Browse files
committed
diagram-generator: be more quiet
Ensures that `make test` does not print to stdout.
1 parent 09d60c5 commit 713de2d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Diff for: diagram-generator/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ test: sample.html
44
sample.html: sample.md
55
@pandoc --self-contained \
66
--lua-filter=diagram-generator.lua \
7-
--metadata=activatePythonPath:"python3 --version" \
87
--metadata=pythonPath:"python3" \
98
--metadata=title:"README" \
109
--output=$@ $<

Diff for: diagram-generator/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ examples](http://www.texample.net/tikz/examples/parallelepiped/) by
156156
~~~~~~~~~~~~~~~~
157157

158158
### Python
159-
In order to use Python to generate an diagram, your Python code must store the
159+
In order to use Python to generate a diagram, your Python code must store the
160160
final image data in a temporary file with the correct format. In case you use
161161
matplotlib for a diagram, add the following line to do so:
162162

@@ -249,4 +249,4 @@ All available meta keys:
249249
- `activatePythonPath`
250250
- `javaPath`
251251
- `dotPath`
252-
- `pdflatexPath`
252+
- `pdflatexPath`

Diff for: diagram-generator/diagram-generator.lua

+6-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ local function tikz2image(src, filetype, additionalPackages)
9898
local tmpDir = "./tmp-latex/"
9999

100100
-- Ensure, that the tmp directory exists:
101-
os.execute("mkdir tmp-latex")
101+
os.execute("mkdir -p tmp-latex")
102102

103103
-- Build and write the LaTeX document:
104104
local f = io.open(tmp .. ".tex", 'w')
@@ -185,9 +185,11 @@ local function py2image(code, filetype)
185185
f:close()
186186

187187
-- Execute Python in the desired environment:
188-
os.execute(
189-
pythonActivatePath .. " && " .. pythonPath .. " " .. pyfile
190-
)
188+
local pycmd = pythonPath .. ' ' .. pyfile
189+
local command = pythonActivatePath
190+
and pythonActivatePath .. ' && ' .. pycmd
191+
or pycmd
192+
os.execute(command)
191193

192194
-- Try to open the written image:
193195
local r = io.open(outfile, 'rb')

0 commit comments

Comments
 (0)