UNPKG

430 Btext/coffeescriptView Raw
1fs = require 'fs'
2path = require 'path'
3
4scripts = ['github-event-announcer.coffee']
5
6module.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)