Permalink
Browse files

Better fetching of documentation resources. Updated for DocPad v6.21

  • Loading branch information...
1 parent 25b4ed9 commit 69eb75406bee97b6252554206c395318903f9488 @balupton balupton committed Jan 4, 2013
Showing with 41 additions and 36 deletions.
  1. +20 −17 app/out/docpad.js
  2. +20 −18 app/src/docpad.coffee
  3. +1 −1 package.json
View
Oops, something went wrong.
View
@@ -264,30 +264,32 @@ docpadConfig =
docpad = @docpad
config = docpad.getConfig()
tasks = new balUtil.Group(next)
-
- # Skip if we are doing a differential generate
- return next() if opts.reset is false or 'development' in docpad.getEnvironments()
-
- # Log
- docpad.log('info', "Updating Documentation...")
-
- # Repos
repos =
'docpad-documentation':
+ name: 'DocPad Documentation'
path: pathUtil.join(config.documentsPaths[0],'docs')
url: 'git://github.com/bevry/docpad-documentation.git'
+
+ # Cycle through the repos assigning each repo value to @ so it works asynchronously
for own repoKey,repoValue of repos
tasks.push repoValue, (complete) ->
- balUtil.initOrPullGitRepo(balUtil.extend({
- remote: 'origin'
- branch: 'master'
- output: true
- next: (err) ->
- # warn about errors, but don't let them kill execution
- docpad.warn(err) if err
- docpad.log('info', "Updated Documentation")
- complete()
- },@))
+ if opts.reset is true or fs.existsSync(@path) is false
+ # Log
+ docpad.log('info', "Updating #{@name}...")
+
+ # Init or Update
+ balUtil.initOrPullGitRepo(balUtil.extend({
+ remote: 'origin'
+ branch: 'master'
+ output: true
+ next: (err) =>
+ # warn about errors, but don't let them kill execution
+ docpad.warn(err) if err
+ docpad.log('info', "Updated #{@name}")
+ complete()
+ },@))
+ else
+ complete()
# Fire
tasks.async()
View
@@ -24,7 +24,7 @@
"npm": "1.1.x"
},
"dependencies": {
- "docpad": "6.20.x",
+ "docpad": "6.21.x",
"docpad-plugin-coffeekup": "2.x",
"docpad-plugin-coffeescript": "2.x",
"docpad-plugin-eco": "2.x",

0 comments on commit 69eb754

Please sign in to comment.