Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all detected components but not those already added #105

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/lib/nodejs/ComponentLoader.coffee
Expand Up @@ -21,7 +21,6 @@ log.pause()
class ComponentLoader extends loader.ComponentLoader
getModuleComponents: (moduleDef, callback) ->
components = {}
@checked.push moduleDef.name

depCount = _.keys(moduleDef.dependencies).length
done = _.after depCount + 1, =>
Expand All @@ -30,10 +29,10 @@ class ComponentLoader extends loader.ComponentLoader
# Handle sub-modules
_.each moduleDef.dependencies, (def) =>
return done() unless def.name?
return done() unless @checked.indexOf(def.name) is -1
@getModuleComponents def, (depComponents) ->
return done() if _.isEmpty depComponents
components[name] = cPath for name, cPath of depComponents
# Add component only if it hasn't been added before
components[name] ?= cPath for name, cPath of depComponents
done()

# No need for further processing for non-NoFlo projects
Expand Down