Skip to content

Commit

Permalink
Beep on generation error
Browse files Browse the repository at this point in the history
  • Loading branch information
holmsand committed Jan 20, 2014
1 parent 446e05a commit 95389b6
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions bin/gen-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,25 @@ var generate = function () {
return fs.readFileSync(x);
}).join("\n"));
console.log('Wrote site');
}
};

var compileOk = function () {
var msg = process.argv[2];
if (msg && msg.match(/failed/)) {
console.log("Compilation failed");
// beep
console.log('\u0007');
return false;
}
return true;
};

console.log('Writing site');
generate();
if (compileOk()) {
console.log('Writing site');
try {
generate();
} catch (e) {
console.log('\u0007');
console.error(e.stack);
}
}

0 comments on commit 95389b6

Please sign in to comment.