UNPKG

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