rename ~/.sonar to ~/.flipper

Summary: renames config folder from sonar to flipper

Reviewed By: jknoxville

Differential Revision: D9541803

fbshipit-source-id: ef378c46fcbb14e76e99fb0743a99f24c536a434
This commit is contained in:
Daniel Büchele
2018-08-29 02:29:14 -07:00
committed by Facebook Github Bot
parent 2596e7d42a
commit f7606c8d59
6 changed files with 15 additions and 9 deletions

View File

@@ -23,7 +23,7 @@ In order for the mobile app to know which certificates it can trust, it conducts
This is achieved through the following steps:
* Desktop app starts an insecure server on port 8089.
* Mobile app connects to localhost:8089 and sends a Certificate Signing Request to the desktop app.
* Desktop app uses it's private key (this is generated once and stored in ~/.sonar) to sign a client certificate for the mobile app.
* Desktop app uses it's private key (this is generated once and stored in ~/.flipper) to sign a client certificate for the mobile app.
* The desktop uses ADB (for android), or the mounted file system (for iOS simulators) to write the following files to the mobile app's private data partition
* Server certificate that the mobile app can now trust.
* Client certificate for the mobile app to use going forward.

View File

@@ -34,7 +34,7 @@ Learn more on how to use [Flipper's UI components](ui-components.md).
### Dynamically loading plugins
Once a plugin is created, Flipper can load it from its folder. The path from where the plugins are loaded is specified in `~/.sonar/config.json`. Add the parent folder of your plugin to `pluginPaths` and start Flipper.
Once a plugin is created, Flipper can load it from its folder. The path from where the plugins are loaded is specified in `~/.flipper/config.json`. Add the parent folder of your plugin to `pluginPaths` and start Flipper.
### npm dependencies

View File

@@ -23,7 +23,7 @@ const {spawn} = require('child_process');
const path = require('path');
const {app, shell} = require('electron').remote;
const SONAR_PLUGIN_PATH = path.join(app.getPath('home'), '.sonar');
const SONAR_PLUGIN_PATH = path.join(app.getPath('home'), '.flipper');
const DYNAMIC_PLUGINS = JSON.parse(window.process.env.PLUGINS || '[]');
type NPMModule = {

View File

@@ -486,5 +486,5 @@ export default class CertificateProvider {
}
function getFilePath(fileName: string): string {
return path.resolve(os.homedir(), '.sonar', 'certs', fileName);
return path.resolve(os.homedir(), '.flipper', 'certs', fileName);
}

View File

@@ -69,7 +69,7 @@ const createModuleIdFactory = () => filePath => {
return id;
};
function pluginEntryPoints(additionalPaths = []) {
const defaultPluginPath = path.join(HOME_DIR, '.sonar', 'node_modules');
const defaultPluginPath = path.join(HOME_DIR, '.flipper', 'node_modules');
const entryPoints = entryPointForPluginFolder(defaultPluginPath);
if (typeof additionalPaths === 'string') {
additionalPaths = [additionalPaths];

View File

@@ -38,13 +38,19 @@ if (process.platform === 'darwin') {
}
}
// ensure .sonar folder and config exist
// ensure .flipper folder and config exist
const sonarDir = path.join(os.homedir(), '.sonar');
if (!fs.existsSync(sonarDir)) {
const flipperDir = path.join(os.homedir(), '.flipper');
if (fs.existsSync(flipperDir)) {
// nothing to do
} else if (fs.existsSync(sonarDir)) {
// move .sonar to .flipper
fs.renameSync(sonarDir, flipperDir);
} else {
fs.mkdirSync(sonarDir);
}
const configPath = path.join(sonarDir, 'config.json');
const configPath = path.join(flipperDir, 'config.json');
let config = {pluginPaths: [], disabledPlugins: [], lastWindowPosition: {}};
try {
@@ -88,7 +94,7 @@ compilePlugins(
}
},
pluginPaths,
path.join(require('os').homedir(), '.sonar', 'plugins'),
path.join(flipperDir, 'plugins'),
).then(dynamicPlugins => {
process.env.PLUGINS = JSON.stringify(dynamicPlugins);
pluginsCompiled = true;