Skip to content
Browse files

Only provide additional motivation for those that want it

  • Loading branch information...
1 parent db9f4f3 commit 8afcdc1690b478d914a0c71fb52df4cded5040ab @mattheath mattheath committed
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/scripts/shipit.coffee
View
14 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
@@ -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.
Something went wrong with that request. Please try again.