This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Janky accepts an optional template parameter

See discussion on Janky pull
github/janky#127
  • Loading branch information...
Iristyle committed Jan 4, 2013
1 parent 604ebcb commit b272a1603f891dd81f8d99db466ad79fdbd6da07
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/scripts/janky.coffee
View
@@ -88,10 +88,13 @@ module.exports = (robot) ->
msg.send response
- robot.respond /ci setup ([\.\-\/_a-z0-9]+)(\s?([\.\-_a-z0-9]+))?/i, (msg) ->
+ robot.respond /ci setup ([\.\-\/_a-z0-9]+)(\s?([\.\-_a-z0-9]+))?(\s?([\.\-_a-z0-9]+))?/i, (msg) ->
nwo = msg.match[1]
params = "?nwo=#{nwo}"
- params += "&name=#{msg.match[3]}" if msg.match[3] != undefined
+ if msg.match[3] != undefined
+ params += "&name=#{msg.match[3]}"
+ if msg.match[5] != undefined
+ params += "&template=#{msg.match[5]}"
post "setup#{params}", {}, (err, statusCode, body) ->
if statusCode == 201

0 comments on commit b272a16

Please sign in to comment.