diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb6f4e13..7c6504614 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +v2.1.1 +* Update behaviour of finishing further execution of listeners +* Scripts are now loaded in the following order + * Scripts defined in `./hubot-scripts.json` are loaded in order + * Scripts are loaded alphabetically from `/scripts` + v2.1.1 ====== * The hwhoops release, finish/done behavior is handled elsewhere diff --git a/bin/hubot b/bin/hubot index 563777e12..e129df50f 100755 --- a/bin/hubot +++ b/bin/hubot @@ -85,12 +85,6 @@ else robot.enableSlash = Options.enableSlash robot.alias = Options.alias - scriptsPath = Path.resolve ".", "scripts" - robot.load scriptsPath - - scriptsPath = Path.resolve "src", "scripts" - robot.load scriptsPath - scriptsFile = Path.resolve "hubot-scripts.json" Path.exists scriptsFile, (exists) => if exists @@ -99,6 +93,13 @@ else scriptsPath = Path.resolve "node_modules", "hubot-scripts", "src", "scripts" robot.loadHubotScripts scriptsPath, scripts + scriptsPath = Path.resolve ".", "scripts" + robot.load scriptsPath + + scriptsPath = Path.resolve "src", "scripts" + robot.load scriptsPath + + robot.run() # vim:ft=coffee ts=2 sw=2 et : diff --git a/src/robot.coffee b/src/robot.coffee index a80dccf6c..8d9d7887d 100644 --- a/src/robot.coffee +++ b/src/robot.coffee @@ -92,6 +92,7 @@ class Robot for listener in @listeners try listener.call message + break if message.done catch ex @logger.error "Unable to call the listener: #{ex}" @@ -301,7 +302,7 @@ class Listener # Returns nothing. call: (message) -> if match = @matcher message - @callback new @robot.Response(@robot, message, match) unless message.done + @callback new @robot.Response(@robot, message, match) class TextListener extends Listener # TextListeners receive every message from the chat source and decide if they want