Skip to content
This repository
Browse code

Janky accepts an optional template parameter

See discussion on Janky pull
github/janky#127
  • Loading branch information...
commit b272a1603f891dd81f8d99db466ad79fdbd6da07 1 parent 604ebcb
Ethan J. Brown authored January 04, 2013

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  src/scripts/janky.coffee
7  src/scripts/janky.coffee
@@ -88,10 +88,13 @@ module.exports = (robot) ->
88 88
 
89 89
       msg.send response
90 90
 
91  
-  robot.respond /ci setup ([\.\-\/_a-z0-9]+)(\s?([\.\-_a-z0-9]+))?/i, (msg) ->
  91
+  robot.respond /ci setup ([\.\-\/_a-z0-9]+)(\s?([\.\-_a-z0-9]+))?(\s?([\.\-_a-z0-9]+))?/i, (msg) ->
92 92
     nwo     = msg.match[1]
93 93
     params  = "?nwo=#{nwo}"
94  
-    params += "&name=#{msg.match[3]}" if msg.match[3] != undefined
  94
+    if msg.match[3] != undefined
  95
+      params += "&name=#{msg.match[3]}"
  96
+      if msg.match[5] != undefined
  97
+        params += "&template=#{msg.match[5]}"
95 98
 
96 99
     post "setup#{params}", {}, (err, statusCode, body) ->
97 100
       if statusCode == 201

0 notes on commit b272a16

Please sign in to comment.
Something went wrong with that request. Please try again.