Skip to content

Commit

Permalink
Merge pull request #195 from whitman/shutdown-hubot
Browse files Browse the repository at this point in the history
Add bot shutdown function
  • Loading branch information
tombell committed Nov 27, 2011
2 parents ec5a335 + 44dd87e commit 53bd377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/adapters/shell.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Shell extends Adapter

@repl.on "close", =>
stdin.destroy()
@robot.shutdown()
process.exit 0

@repl.on "line", (buffer) =>
Expand Down
4 changes: 4 additions & 0 deletions src/robot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ class Robot
run: ->
@adapter.run()

shutdown: ->
@adapter.close()
@brain.close()

class Robot.Message
# Represents an incoming message from the chat.
#
Expand Down

0 comments on commit 53bd377

Please sign in to comment.