Permalink
Browse files

v6.17.3. Bugfix.

- v6.17.3 December 5, 2012
	- Fixed an issue introduced in v6.17.0 that prevented files from
reloading under certain circumstances
		- Thanks [Vladislav Botvin](https://github.com/darrrk) for [issue
#370](#370) and [pull request
#371](#371)
  • Loading branch information...
balupton committed Dec 5, 2012
1 parent a4227e4 commit 19ee9874c2648f99f18c2e094e8bed43a84f9cbd
Showing with 22 additions and 11 deletions.
  1. +4 −0 History.md
  2. +2 −1 package.json
  3. +16 −10 src/lib/models/file.coffee
View
@@ -1,5 +1,9 @@
## History
- v6.17.3 December 5, 2012
- Fixed an issue introduced in v6.17.0 that prevented files from reloading under certain circumstances
- Thanks [Vladislav Botvin](https://github.com/darrrk) for [issue #370](https://github.com/bevry/docpad/issues/370) and [pull request #371](https://github.com/bevry/docpad/pull/371)
- v6.17.2 December 5, 2012
- `watch` and `server` actions now perform an initial generation
- Thanks [Khalid Jebbari](https://github.com/DjebbZ), [Vladislav Botvin](https://github.com/darrrk)
View
@@ -1,6 +1,6 @@
{
"name": "docpad",
"version": "6.17.2",
"version": "6.17.3",
"description": "DocPad is a language agnostic document management system. This means you write your website as documents, in whatever language you wish, and DocPad will handle the compiling, templates and layouts for you. For static documents it will generate static files, for dynamic documents it'll re-render them on each request. You can utilise DocPad by itself, or use it as a module your own custom system. It's pretty cool, and well worth checking out. We love it.",
"homepage": "https://github.com/bevry/docpad",
"installUrl": "http://docpad.org/install",
@@ -43,6 +43,7 @@
"Ferrari Lee <shiyung@gmail.com> (https://github.com/Ferrari)",
"Ben Barber (https://github.com/barberboy)",
"Luke Hagan (https://github.com/lhagan)",
"Vladislav Botvin <darkvlados@me.com> (https://github.com/darrrk)",
"Sven Vetsch (https://github.com/disenchant)"
],
"bugs": {
View
@@ -337,7 +337,7 @@ class FileModel extends Model
file.set({fullPath})
# Log
file.log('notice', "Loading the file: #{fullPath}")
file.log('debug', "Loading the file: #{fullPath}")
# Async
tasks = new balUtil.Group (err) =>
@@ -351,29 +351,35 @@ class FileModel extends Model
# Read the data if it is set
tasks.push (complete) ->
file.log('notice', "Data check for: #{fullPath}")
data = file.getData()
if data
buffer = new Buffer(data)
file.setBuffer(buffer)
tasks.exit()
return tasks.exit()
else
complete()
return complete()
# Stat the file and cache the result
tasks.push (complete) ->
file.log('notice', "Stat check for: #{fullPath}")
#return complete() if file.getStat()
# Check for override stat
if opts.stat
file.setBuffer(opts.stat)
return complete()
# Otherwise fetch new stat
balUtil.stat fullPath, (err,fileStat) ->
return complete(err) if err
file.setStat(fileStat)
tasks.complete()
return complete()
# Read the file and cache the result
tasks.push (complete) ->
file.log('notice', "Read check for: #{fullPath}")
#return complete() if file.getBuffer()
file.log('notice', "Read check blah: #{fullPath}")
# Check for override buffer
if opts.buffer
file.setBuffer(opts.buffer)
return complete()
# Otherwise fetch new buffer
balUtil.readFile fullPath, (err,buffer) ->
return complete(err) if err
file.setBuffer(buffer)

0 comments on commit 19ee987

Please sign in to comment.