UNPKG

393 Btext/coffeescriptView Raw
1fs = require 'fs'
2path = require 'path'
3
4module.exports = (robot, scripts) ->
5 scriptsPath = path.resolve(__dirname, 'src')
6 fs.exists scriptsPath, (exists) ->
7 if exists
8 for script in fs.readdirSync(scriptsPath)
9 if scripts? and '*' not in scripts
10 robot.loadFile(scriptsPath, script) if script in scripts
11 else
12 robot.loadFile(scriptsPath, script)