Skip to content

Commit

Permalink
changing the action method to allow a complet callback
Browse files Browse the repository at this point in the history
this will allow devs to use the pipeline and not have the app quit
  • Loading branch information
aaronpowell committed Sep 23, 2011
1 parent ae35e80 commit e02d065
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/docpad.coffee
Expand Up @@ -361,7 +361,7 @@ class Docpad


# Handle
action: (action) ->
action: (action, complete = -> process.exit()) ->
# Clear
if @actionTimeout
clearTimeout(@actionTimeout)
Expand All @@ -372,7 +372,7 @@ class Docpad
logger.log 'notice', 'Action received, but we still loading... waiting...'
@actionTimeout = setTimeout(
=>
@action action
@action action, complete
500
)
return
Expand All @@ -382,12 +382,12 @@ class Docpad
when 'skeleton', 'scaffold'
@skeletonAction (err) ->
return @error(err) if err
process.exit()
complete()

when 'generate'
@generateAction (err) ->
return @error(err) if err
process.exit()
complete()

when 'watch'
@watchAction (err) ->
Expand Down

0 comments on commit e02d065

Please sign in to comment.