allow tilde in pluginPaths
Summary: `~` is not supported by node's `fs` functions. So we are replacing it manually. Reviewed By: priteshrnandgaonkar Differential Revision: D8658889 fbshipit-source-id: 36c9885a00a7e07e54ab416d6fda3b29bbda73b6
This commit is contained in:
committed by
Facebook Github Bot
parent
c6eb0d6b1a
commit
0d5c98341a
@@ -9,9 +9,10 @@ const path = require('path');
|
||||
const url = require('url');
|
||||
const fs = require('fs');
|
||||
const compilePlugins = require('./compilePlugins.js');
|
||||
const os = require('os');
|
||||
|
||||
// ensure .sonar folder and config exist
|
||||
const sonarDir = path.join(require('os').homedir(), '.sonar');
|
||||
const sonarDir = path.join(os.homedir(), '.sonar');
|
||||
if (!fs.existsSync(sonarDir)) {
|
||||
fs.mkdirSync(sonarDir);
|
||||
}
|
||||
@@ -33,6 +34,7 @@ const pluginPaths = config.pluginPaths
|
||||
path.join(__dirname, '..', 'src', 'plugins'),
|
||||
path.join(__dirname, '..', 'src', 'fb', 'plugins'),
|
||||
)
|
||||
.map(p => p.replace(/^~/, os.homedir()))
|
||||
.filter(fs.existsSync);
|
||||
|
||||
process.env.CONFIG = JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user