Skip to content

Commit

Permalink
use tmp file for stderr - fixes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
raghur committed Oct 1, 2022
1 parent 0d79cce commit 6181062
Show file tree
Hide file tree
Showing 4 changed files with 1,230 additions and 585 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ var counter = 0;
var folder = process.cwd()
// Create a writeable stream to redirect stderr to file - if it logs to stdout, then pandoc hangs due to improper json.
// errorLog is used in pandoc.toJSONFilter
var errFile = path.join(folder, "mermaid-filter.err");
var errorLog = fs.createWriteStream(errFile);
var tmpObj = tmp.fileSync({ mode: 0644, prefix: 'mermaid-filter-', postfix: '.err' });
var errorLog = fs.createWriteStream(tmpObj.name)

// console.log(folder)
function mermaid(type, value, format, meta) {
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"minimist": ">=0.2.1",
"pandoc-filter": "^0.1.3",
"sanitize-filename": "1.6.1",
"tmp": "0.0.28"
"tmp": "^0.0.28"
}
}
Loading

0 comments on commit 6181062

Please sign in to comment.