@@ -5,10 +5,21 @@ var plugin_manager = function (config, configPath) {
5
5
fs = require ( 'fs-extra' ) ,
6
6
util = require ( './utilities' ) ;
7
7
8
+ /**
9
+ * Loads a plugin
10
+ *
11
+ * @param pluginName {string} the name of the plugin
12
+ * @return {object } the loaded plugin
13
+ */
8
14
function loadPlugin ( pluginName ) {
9
15
return require ( path . join ( process . cwd ( ) , 'node_modules' , pluginName ) ) ;
10
16
}
11
17
18
+ /**
19
+ * Installs a plugin
20
+ *
21
+ * @param pluginName {string} the name of the plugin
22
+ */
12
23
function installPlugin ( pluginName ) {
13
24
try {
14
25
var pluginPath = path . resolve (
@@ -40,6 +51,11 @@ var plugin_manager = function (config, configPath) {
40
51
}
41
52
}
42
53
54
+ /**
55
+ * Detect installed plugins
56
+ *
57
+ * @return {array } list of installed plugins
58
+ */
43
59
function detectPlugins ( ) {
44
60
var node_modules_path = path . join ( process . cwd ( ) , 'node_modules' ) ;
45
61
return fs . readdirSync ( node_modules_path ) . filter ( function ( dir ) {
@@ -48,10 +64,18 @@ var plugin_manager = function (config, configPath) {
48
64
} ) ;
49
65
}
50
66
67
+ /**
68
+ * Disables an installed plugin
69
+ * Not implemented yet
70
+ */
51
71
function disablePlugin ( pluginName ) {
52
72
console . log ( 'disablePlugin not implemented yet. No change made to state of plugin' , pluginName ) ;
53
73
}
54
74
75
+ /**
76
+ * Enables an installed plugin
77
+ * Not implemented yet
78
+ */
55
79
function enablePlugin ( pluginName ) {
56
80
console . log ( 'enablePlugin not implemented yet. No change made to state of plugin' , pluginName ) ;
57
81
}
0 commit comments