clean up dynamic plugin loading
Summary: There are 3 sources where plugins can be loaded from: * `src/plugins` * `src/fb/plugins` * any path specified in `~/.sonar/config.json` Plugins found in the first two directories are bundled with the app when building. Reviewed By: jknoxville Differential Revision: D8636061 fbshipit-source-id: 2064090d43d11695ffd99df195e5b594559fe087
This commit is contained in:
committed by
Facebook Github Bot
parent
70e11e8269
commit
5edb8bd770
@@ -8,7 +8,6 @@ const {app, BrowserWindow} = require('electron');
|
||||
const path = require('path');
|
||||
const url = require('url');
|
||||
const fs = require('fs');
|
||||
const yargs = require('yargs');
|
||||
const compilePlugins = require('./compilePlugins.js');
|
||||
|
||||
// ensure .sonar folder and config exist
|
||||
@@ -29,9 +28,12 @@ try {
|
||||
fs.writeFileSync(configPath, JSON.stringify(config));
|
||||
}
|
||||
|
||||
const pluginPaths = config.pluginPaths.concat(
|
||||
(yargs.argv.dynamicPlugins || '').split(',').filter(Boolean),
|
||||
);
|
||||
const pluginPaths = config.pluginPaths
|
||||
.concat(
|
||||
path.join(__dirname, '..', 'src', 'plugins'),
|
||||
path.join(__dirname, '..', 'src', 'fb', 'plugins'),
|
||||
)
|
||||
.filter(fs.existsSync);
|
||||
|
||||
process.env.CONFIG = JSON.stringify({
|
||||
...config,
|
||||
|
||||
Reference in New Issue
Block a user