Skip to content

Commit

Permalink
v6.63.6. Improvement.
Browse files Browse the repository at this point in the history
- v6.63.6 February 18, 2014
	- Fixed npm v1.4.3 from using `^` instead of `~` when installing and updating docpad plugins
  • Loading branch information
balupton committed Feb 18, 2014
1 parent 24adf0d commit 1656771
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# History

- v6.63.6 February 18, 2014
- Fixed npm v1.4.3 from using `^` instead of `~` when installing and updating docpad plugins

- v6.63.5 February 18, 2014
- Fixed invalid TaskGroup `~3.3.7n` dependency version (regression since v6.63.1)
- Thanks to [Jens Wilke](https://github.com/cruftex) for [issue #806](https://github.com/bevry/docpad/issues/806)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "DocPad. Streamlined web development.",
"name": "docpad",
"version": "6.63.5",
"version": "6.63.6",
"description": "DocPad is a next generation web architecture that lets you create fast static websites with dynamic abilities and powerful abstractions. Write your website as files on your computer, entries in a database, or even RSS feeds and DocPad will import it, generate & render it, then output a static website for deployment anywhere or a dynamic node website for advanced server-side functionality. Use it as a module or standalone. It's purely awesome. Check it out.",
"homepage": "http://docpad.org",
"installUrl": "http://docpad.org/install",
Expand Down
28 changes: 28 additions & 0 deletions src/lib/docpad.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,28 @@ class DocPad extends EventEmitterGrouped
# Chain
@

# Fix Node Package Versions
# Combat to https://github.com/npm/npm/issues/4587#issuecomment-35370453
# next(err)
fixNodePackageVersions: (opts) ->
# Prepare
[opts,next] = extractOptsAndCallback(opts, next)
docpad = @
config = @getConfig()

# Extract
opts.packagePath ?= config.packagePath

# Read and replace
safefs.readFile opts.packagePath, (err,buffer) ->
data = buffer.toString()
data = data.replace(/("docpad(?:.*?)": ")\^/g, '$1~')
safefs.writeFile opts.packagePath, data, (err) ->
return next(err)

# Chain
@

# Install Node Module
# next(err,result)
installNodeModule: (names,opts) ->
Expand Down Expand Up @@ -4106,6 +4128,9 @@ class DocPad extends EventEmitterGrouped
next: complete
})

tasks.addTask "fix node package versions", (complete) ->
docpad.fixNodePackageVersions(complete)

tasks.addTask "re-load the configuration", (complete) ->
docpad.load(complete)

Expand Down Expand Up @@ -4170,6 +4195,9 @@ class DocPad extends EventEmitterGrouped
next: complete
})

tasks.addTask "fix node package versions", (complete) ->
docpad.fixNodePackageVersions(complete)

tasks.addTask "re-initialize the rest of the website's modules", (complete) ->
docpad.initNodeModules({
output: true
Expand Down

0 comments on commit 1656771

Please sign in to comment.