UNPKG

759 Btext/coffeescriptView Raw
1path = require 'path'
2
3phabs_available_features = [
4 'events',
5 'api',
6 'feeds',
7 'commands',
8 'templates',
9 'admin',
10 'hear'
11]
12
13phabs_features = if process.env.PHABS_ENABLED_FEATURES?
14 enabled = process.env.PHABS_ENABLED_FEATURES.split(',')
15 phabs_available_features.reduce (a, f) ->
16 a.push f if f in enabled
17 a
18 , [ ]
19else if process.env.PHABS_DISABLED_FEATURES?
20 disabled = process.env.PHABS_DISABLED_FEATURES.split(',')
21 phabs_available_features.reduce (a, f) ->
22 a.push f if f not in disabled
23 a
24 , [ ]
25else
26 phabs_available_features
27
28module.exports = (robot) ->
29 for feature in phabs_features
30 robot.logger.debug "Loading phabs_#{feature}"
31 robot.loadFile(path.resolve(__dirname, 'scripts'), "phabs_#{feature}.coffee")