Skip to content

Commit

Permalink
v6.34.0. Bugfix. Improvement.
Browse files Browse the repository at this point in the history
- v6.34.0 May 8, 2013
	- Now uses [envfile](https://github.com/bevry/envfile) for `.env` file
parsing
	- Fixed `TypeError: Cannot call method 'get' of undefined ->
/lib/docpad.js:972` error when using [minicms
plugin](https://github.com/jeremyfa/docpad-plugin-minicms)
		- Closes [issue docpad#501](docpad#501)
reported by [rleite](https://github.com/rleite)
  • Loading branch information
balupton committed May 8, 2013
1 parent 210a2e4 commit 7a5fe61
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## History

- v6.34.0 May 8, 2013
- Now uses [envfile](https://github.com/bevry/envfile) for `.env` file parsing
- Fixed `TypeError: Cannot call method 'get' of undefined -> /lib/docpad.js:972` error when using [minicms plugin](https://github.com/jeremyfa/docpad-plugin-minicms)
- Closes [issue #501](https://github.com/bevry/docpad/issues/501) reported by [rleite](https://github.com/rleite)

- v6.33.0 May 6, 2013
- We now load the exchange file based on which DocPad version we are running
- Updated dependencies
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docpad",
"version": "6.33.0",
"version": "6.34.0",
"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",
Expand Down Expand Up @@ -89,7 +89,8 @@
"yamljs": "~0.1.4",
"getmac": "~1.0.4",
"canihaz": "~1.0.0",
"progressbar": "~1.0.1"
"progressbar": "~1.0.1",
"envfile": "~1.0.0"
},
"optionalDependencies": {
"airbrake": "~0.2.9",
Expand Down
26 changes: 12 additions & 14 deletions src/lib/docpad.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1065,12 +1065,16 @@ class DocPad extends EventEmitterEnhanced
# Update the cache entry and fetch the latest if it was already set
existingModelId = @filesByOutPath[outPath] ?= model.id
if existingModelId isnt model.id
# We have a conflict, let the user know
modelPath = model.get('fullPath')
existingModel = @database.get(existingModelId)
existingModelPath = existingModel.get('fullPath')
message = util.format(docpad.getLocale().outPathConflict, outPath, modelPath, existingModelPath)
docpad.warn(message)
if existingModel
# We have a conflict, let the user know
modelPath = model.get('fullPath')
existingModelPath = existingModel.get('fullPath')
message = util.format(docpad.getLocale().outPathConflict, outPath, modelPath, existingModelPath)
docpad.warn(message)
else
# There reference was old, update it with our new one
@filesByOutPath[outPath] = model.id
)
@locales = extendr.dereference(@locales)
@userConfig = extendr.dereference(@userConfig)
Expand Down Expand Up @@ -1439,16 +1443,10 @@ class DocPad extends EventEmitterEnhanced
envPath = pathUtil.join(rootPath, '.env')
safefs.exists envPath, (exists) ->
return complete() unless exists
safefs.readFile envPath, (err,data) ->
require('envfile').parseFile envPath, (err,data) ->
return complete(err) if err
result = data.toString()
lines = result.split('\n')
for line in lines
match = line.match(/^([^=]+?)=(.*)/)
if match
key = match[1]
value = match[2]
process.env[key] = value
for own key,value of data
process.env[key] = value
return complete()

# Load Website's Configuration
Expand Down

0 comments on commit 7a5fe61

Please sign in to comment.