1 | fs = require 'fs'
|
2 | path = require 'path'
|
3 |
|
4 | scripts = ['github-event-announcer.coffee']
|
5 |
|
6 | module.exports = (robot) ->
|
7 | scriptsPath = path.resolve(__dirname, 'src')
|
8 |
|
9 | fs.exists scriptsPath, (exists) ->
|
10 | if exists
|
11 | for script in fs.readdirSync(scriptsPath)
|
12 | if scripts? and '*' not in scripts
|
13 | robot.loadFile(scriptsPath, script) if script in scripts
|
14 | else
|
15 | robot.loadFile(scriptsPath, script)
|