probmods / webppl-viz

Visualization for WebPPL
http://probmods.github.io/webppl-viz/
Other
14 stars 9 forks source link

fix unresolved fs call #88

Closed smihael closed 6 years ago

smihael commented 6 years ago

As an addition to pull request #87 and advice of @longouyang againt globally requiring fs, this is a small edit, which directly requires fs, which fixes the problem with the if (fs.existsSync(fileName)) call (line 1050), where fs was previously not resolved (as there was no such symbol defined in the global scope). Additionally, I fixed renaming logic in the case the file already exists, so e.g. no "....svg_213" will be created but "..._213.svg" as intended.