Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Only provide additional motivation for those that want it
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheath committed Nov 1, 2012
1 parent db9f4f3 commit 8afcdc1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/scripts/shipit.coffee
@@ -1,11 +1,14 @@
# Description:
# Rodent Motivation
#
# Set the environment variable HUBOT_SHIP_EXTRA_SQUIRRELS (to anything)
# for additional motivation
#
# Dependencies:
# None
#
# Configuration:
# None
# HUBOT_SHIP_EXTRA_SQUIRRELS
#
# Commands:
# ship it - Display a motivation squirrel
Expand Down Expand Up @@ -34,5 +37,12 @@ squirrels = [
]

module.exports = (robot) ->
robot.hear /ship(ping|z|s|ped)? it/i, (msg) ->

# Enable a looser regex if environment variable is set
if process.env.HUBOT_SHIP_EXTRA_SQUIRRELS
regex = /ship(ping|z|s|ped)? it/i
else
regex = /ship it/i

robot.hear regex, (msg) ->
msg.send msg.random squirrels

0 comments on commit 8afcdc1

Please sign in to comment.