Skip to content

Commit

Permalink
set encoding in readFile to get string instead of buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-carvalho committed Sep 4, 2011
1 parent 059ec7d commit a8f3a93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cli.coffee
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit a8f3a93

Please sign in to comment.