From a8f3a93159ffba9996a700b74eac59062ac0ed34 Mon Sep 17 00:00:00 2001 From: Rachel Carvalho Date: Sun, 4 Sep 2011 17:33:27 -0300 Subject: [PATCH] set encoding in readFile to get string instead of buffer --- src/cli.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli.coffee b/src/cli.coffee index d8104f7..213b946 100644 --- a/src/cli.coffee +++ b/src/cli.coffee @@ -10,10 +10,10 @@ options = null handle_error = (err) -> console.log err.stack if err render = (input_path, output_directory) -> - fs.readFile input_path, (err, contents) -> + fs.readFile input_path, 'utf-8', (err, contents) -> handle_error err try - html = coffeekup.render String(contents), options + html = coffeekup.render contents, options write input_path, html, output_directory catch err handle_error err @@ -57,8 +57,8 @@ switches = [ if options.utils options.locals ?= {} options.locals.render = (file) -> - contents = fs.readFileSync file - coffeekup.render String(contents), options + contents = fs.readFileSync file, 'utf-8' + coffeekup.render contents, options if args.length > 0 file = args[0]