Skip to content

Commit

Permalink
check fileExists for outputFile (nim-lang#24211)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Oct 1, 2024
1 parent a5f46a7 commit 0e1df88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,8 @@ proc writeJsonBuildInstructions*(conf: ConfigRef; deps: StringTableRef) =
bcache.depfiles.add (path, $secureHashFile(path))

bcache.nimexe = hashNimExe()
bcache.outputLastModificationTime = $getLastModificationTime(bcache.outputFile)
if fileExists(bcache.outputFile):
bcache.outputLastModificationTime = $getLastModificationTime(bcache.outputFile)
conf.jsonBuildFile = conf.jsonBuildInstructionsFile
conf.jsonBuildFile.string.writeFile(bcache.toJson.pretty)

Expand Down

0 comments on commit 0e1df88

Please sign in to comment.