File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ module.exports = (robot) ->
26
26
unspaced = (spaced ) ->
27
27
spaced .replace / \s + / g , " ."
28
28
29
+ unique = (arr ) ->
30
+ output = {}
31
+ output[arr[key]] = arr[key] for key in [0 ... arr .length ]
32
+ value for key, value of output
33
+
29
34
robot .respond /// conf\s + get\s + "(#{ SPACED_IDENTIFIER} )"/// , (res ) ->
30
35
respondGet res, unspaced (res .match [1 ])
31
36
@@ -84,7 +89,17 @@ module.exports = (robot) ->
84
89
85
90
respondDump = (res , prefix ) ->
86
91
response = []
87
- for key in conf .keys ()
92
+ keys = conf .keys ()
93
+ fixCase = (key ) ->
94
+ key .toLowerCase ().replace (/ _/ g , ' .' ).substring (' HUBOT_' .length )
95
+ envs = (fixCase (key) for own key, val of process .env when key .indexOf (' HUBOT_' ) is 0 )
96
+ keys = unique (keys .concat (envs))
97
+ keys .sort ()
98
+ for key in keys
88
99
if (not prefix? ) or key .indexOf (prefix) is 0
89
- response .push " #{ key} = `#{ JSON .stringify conf .get key} `"
100
+ [value , set ] = common .resolveStat conf, key
101
+ if set
102
+ response .push " #{ key} = `#{ JSON .stringify value} `"
103
+ else
104
+ response .push " #{ key} = `#{ JSON .stringify value} ` (environment variable)"
90
105
res .send response .join " \n "
You can’t perform that action at this time.
0 commit comments