Permalink
Browse files

fix crash when dependency is missing

  • Loading branch information...
1 parent 7248801 commit 7a64c4cbcf2b21202a24fbc40bbb8031cde51077 @andrewrk committed Jul 10, 2012
Showing with 14 additions and 14 deletions.
  1. +1 −1 cmd.js
  2. +6 −6 jspackage.js
  3. +1 −1 src/cmd.coffee
  4. +6 −6 src/jspackage.coffee
View
2 cmd.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -52,7 +52,7 @@ compile options, (err, code) ->
if options.watch
timestamp = (new Date()).toLocaleTimeString()
if err
- console.error("#{timestamp} - error: #{err}")
+ console.error("#{timestamp} - error: #{err}")
else
console.info("#{timestamp} - generated #{output}")
fs.writeFile(output, code)
View
@@ -87,7 +87,7 @@ resolveDependencyChain = (root, doneResolvingDependencyChain) ->
processNode = (node, doneProcessingNode) ->
async.map node.deps, resolveDepend, (err, resolved_deps) ->
if err
- doneResolvingDependencyChain err
+ doneProcessingNode(err)
return
funcs = []
for dep in resolved_deps
@@ -97,13 +97,13 @@ resolveDependencyChain = (root, doneResolvingDependencyChain) ->
seen[file.path] = true
funcs.push async.apply(processNode, file)
async.parallel funcs, (err, results) ->
+ files.push node
if err
- doneResolvingDependencyChain err
+ doneProcessingNode(err)
return
- files.push node
- doneProcessingNode()
- processNode root, ->
- doneResolvingDependencyChain null, files
+ doneProcessingNode(null)
+ processNode root, (err) ->
+ doneResolvingDependencyChain err, files
collectDependencies = (dep, doneCollectingDependencies) ->
resolveDepend dep, (err, resolved_dep) ->

0 comments on commit 7a64c4c

Please sign in to comment.