MCPcopy
hub / github.com/Doorman11991/smallcode / loadAll

Method loadAll

src/plugins/loader.js:50–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49 // Load all plugins from project + user dirs
50 loadAll() {
51 const dirs = [
52 path.join(this.projectDir, '.smallcode', 'plugins'),
53 path.join(os.homedir(), '.config', 'smallcode', 'plugins'),
54 ];
55
56 for (const dir of dirs) {
57 if (!fs.existsSync(dir)) continue;
58 const entries = fs.readdirSync(dir, { withFileTypes: true });
59 for (const entry of entries) {
60 if (entry.isDirectory()) {
61 this._loadPlugin(path.join(dir, entry.name));
62 } else if (entry.name.endsWith('.json') && entry.name !== 'package.json') {
63 // Single-file plugin (just a manifest with inline content)
64 this._loadSingleFile(path.join(dir, entry.name));
65 }
66 }
67 }
68
69 return this;
70 }
71
72 _loadPlugin(pluginDir) {
73 const manifestPath = path.join(pluginDir, 'plugin.json');

Callers 2

mainFunction · 0.80
commands.jsFile · 0.80

Calls 2

_loadPluginMethod · 0.95
_loadSingleFileMethod · 0.95

Tested by

no test coverage detected