Permalink
Browse files

Add a 'backupFile' member to use if the first fails

  • Loading branch information...
1 parent d6dac6b commit 5a656b4be3da02a072ca4963d832123faeee6d0b @isaacs isaacs committed Jun 17, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 promzard.js
View
@@ -46,6 +46,11 @@ PromZard.prototype.load = function () {
return this.loaded()
fs.readFile(this.file, 'utf8', function (er, d) {
+ if (er && this.backupFile) {
+ this.file = this.backupFile
+ delete this.backupFile
+ return this.load()
+ }
if (er)
return this.emit('error', this.error = er)
files[this.file] = d

0 comments on commit 5a656b4

Please sign in to comment.