github/hubot — Issue #212: Hubot v2.0.7 loading duplicate scripts?
Author: zomble
Created: 2011-12-16 01:07:05+00:00
State: open

Hey,

I've got Hubot running on Heroku and have noticed an interesting feature about Hubot.

Hubot will load scripts from the following directories..

[Thu, 15 Dec 2011 00:45:06 GMT] INFO Loading scripts from /app/scripts
[Thu, 15 Dec 2011 00:45:06 GMT] INFO Loading scripts from /app/src/scripts
[Thu, 15 Dec 2011 00:45:06 GMT] INFO Loading hubot-scripts from /app/node_modules/hubot-scripts/src/scripts

The problem is if I have the same script in more then two of these directories Hubot appears to double load it...

Example with location-decision-maker.coffee

Paul C.
Hubot remember Nandos as a lunch location
Hubot
Nom peri peri. My fav.
Nom peri peri. My fav.

and

Paul C.
Hubot help
Hubot
View paste (18 more lines)
tweet - Returns a link to a tweet about
is a badass guitarist - assign a role to a user
is not a badass guitarist - remove a role from a user
animate me - The same thing as `image me`, except adds a few
convert me to - Convert expression to given units.
forget as a location - Forgets the location from the group.
forget as a location - Forgets the location from the group.
forget all locations for - Forgets all the locations for the group.
forget all locations for - Forgets all the locations for the group.
google me - Googles & returns 1st result's URL
google me - Googles & returns 1st result's URL
help - Displays all of the help commands that Hubot knows about.
help - Displays all help commands that match .
image me - The Original. Queries Google Images for and
map me - Returns a map view of the area returned by `query`.
math me - Calculate the given expression.
mustache me - Searches Google Images for the specified query and
mustache me - Adds a mustache to the specified URL.
pug bomb N - get N pugs
pug me - Receive a pug
remember as a location - Remembers the location for the group.
remember as a location - Remembers the location for the group.
ship it - Display a motivation squirrel
show storage - Display the contents that are persisted in redis
show users - Display all users that hubot knows about
translate me - Searches for a translation for the and then
translate me from into - Translates from into . Both and are optional
where can we go for ? - Returns a list of places that exist for the group.
where can we go for ? - Returns a list of places that exist for the group.
where should we go for ? - Returns a randomly selected location for the group.
where should we go for ? - Returns a randomly selected location for the group.
who is - see what roles a user has
youtube me - Searches YouTube for the query and returns the video

Removing the coffee script from /app/src/scripts and leaving just the copy in /app/node_modules/hubot-scripts/src/scripts to load, it returns to normal and I get no more doubling up.

I'm not certain if this is expected behaviour, or if it's something I've done. (New to Hubot, coffee, heroku, node.js)

Judging by bin/hubot i could remove "node_modules", from scriptsPath = Path.resolve "node_modules", "hubot-scripts", "src", "scripts" and all would be sweet for me.

Any clarification would be most welcome.

Thanks!