nimpretty: fixes #9499
This commit is contained in:
parent
223e92b83a
commit
5fd2827ab6
1 changed files with 4 additions and 0 deletions
|
|
@ -55,9 +55,13 @@ proc openEmitter*(em: var Emitter, cache: IdentCache;
|
||||||
em.lastLineNumber = 1
|
em.lastLineNumber = 1
|
||||||
|
|
||||||
proc closeEmitter*(em: var Emitter) =
|
proc closeEmitter*(em: var Emitter) =
|
||||||
|
if fileExists(em.config.outFile) and readFile(em.config.outFile.string) == em.content:
|
||||||
|
discard "do nothing, see #9499"
|
||||||
|
return
|
||||||
var f = llStreamOpen(em.config.outFile, fmWrite)
|
var f = llStreamOpen(em.config.outFile, fmWrite)
|
||||||
if f == nil:
|
if f == nil:
|
||||||
rawMessage(em.config, errGenerated, "cannot open file: " & em.config.outFile.string)
|
rawMessage(em.config, errGenerated, "cannot open file: " & em.config.outFile.string)
|
||||||
|
return
|
||||||
f.llStreamWrite em.content
|
f.llStreamWrite em.content
|
||||||
llStreamClose(f)
|
llStreamClose(f)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue