Skip to content

Commit

Permalink
removed options hash, using argv instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Oct 7, 2012
1 parent d09a429 commit 3084a66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var fs = require('fs'),
mustache = require('mustache'),
render = require('./render').render;

exports.init = function(argv) {
Expand All @@ -9,14 +8,10 @@ exports.init = function(argv) {
process.exit(1);
}

var options = {
debug: argv.debug
};

fs.readFile(argv.file, 'utf8', function(err, data) {
if (err) throw err;
var contents = JSON.parse(data.replace(/\n/g,''));
render(contents, options);
render(contents, argv);
});

};
5 changes: 3 additions & 2 deletions lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ exports.render = function(json, options) {
fs.readFile('templates/layout.mustache', 'utf8', function(err, data) {
if (err) throw err;
var output = mustache.render(data, { slides: slides });
if (options.debug)
if (options.debug) {
console.log(output);
else
} else {
fs.writeFile('output.html', output);
}
});
};

0 comments on commit 3084a66

Please sign in to comment.