-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathenable.js
More file actions
32 lines (29 loc) · 620 Bytes
/
enable.js
File metadata and controls
32 lines (29 loc) · 620 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
/**
* Enable a configuration setting. Also pass `-c` to save the
* value to the `verb.config` object in package.json.
*
* ```sh
* $ app --enable toc
* ```
* @name enable
* @api public
*/
module.exports = function(app) {
return function(prop, key, config, next) {
if (prop === 'toc') {
app.base.enable('toc.render');
if (config.c === true) {
app.pkg.set('verb.toc', true);
app.pkg.save();
}
} else {
app.base.enable(prop);
if (config.c === true) {
app.pkg.set(prop, true);
app.pkg.save();
}
}
next();
};
};