Skip to content

Commit

Permalink
Doesn't unlink existing files for reports. Fixes apiaryio#57
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Cordell committed Mar 10, 2014
1 parent cef670f commit 1c142f7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/reporters/html-reporter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class HtmlReporter extends EventEmitter
sanitizedPath: (path) =>
filePath = if path? then process.cwd() + "/" + path else process.cwd() + "/report.html"
if fs.existsSync(filePath)
logger.info "File exists at #{filePath}, deleting..."
fs.unlinkSync(filePath)
logger.info "File exists at #{filePath}, will be overwritten..."
filePath

configureEmitter: (emitter) =>
Expand Down
3 changes: 1 addition & 2 deletions src/reporters/markdown-reporter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class MarkdownReporter extends EventEmitter
sanitizedPath: (path) =>
filePath = if path? then process.cwd() + "/" + path else process.cwd() + "/report.md"
if fs.existsSync(filePath)
logger.info "File exists at #{filePath}, deleting..."
fs.unlinkSync(filePath)
logger.info "File exists at #{filePath}, will be overwritten..."
filePath

configureEmitter: (emitter) =>
Expand Down
3 changes: 1 addition & 2 deletions src/reporters/x-unit-reporter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class XUnitReporter extends EventEmitter
sanitizedPath: (path) =>
filePath = if path? then process.cwd() + "/" + path else process.cwd() + "/report.xml"
if fs.existsSync(filePath)
logger.info "File exists at #{filePath}, deleting..."
fs.unlinkSync(filePath)
logger.info "File exists at #{filePath}, will be overwritten..."
filePath

configureEmitter: (emitter) =>
Expand Down

0 comments on commit 1c142f7

Please sign in to comment.