Add a single place to initialize Flipper utilitary folders
Summary: We have several folders Flipper uses that sometimes we forget to create before Flipper starts. With this diff we have a single place to initialise the necessary folder structure. Reviewed By: lblasa Differential Revision: D37036601 fbshipit-source-id: f945f2bfdfc6be24ba87bd4b13c7fcef3fd74451
This commit is contained in:
committed by
Facebook GitHub Bot
parent
60f9a5e8de
commit
d987e36c62
@@ -50,6 +50,8 @@ import rm from 'rimraf';
|
||||
import assert from 'assert';
|
||||
import {initializeAdbClient} from './devices/android/adbClient';
|
||||
import {assertNotNull} from './comms/Utilities';
|
||||
import {mkdirp} from 'fs-extra';
|
||||
import {flipperDataFolder, flipperSettingsFolder} from './utils/paths';
|
||||
|
||||
const {access, copyFile, mkdir, unlink, stat, readlink, readFile, writeFile} =
|
||||
promises;
|
||||
@@ -167,6 +169,7 @@ export class FlipperServerImpl implements FlipperServer {
|
||||
this.setServerState('starting');
|
||||
|
||||
try {
|
||||
await this.createFolders();
|
||||
await this.server.init();
|
||||
await this.pluginManager.start();
|
||||
await this.startDeviceListeners();
|
||||
@@ -179,6 +182,11 @@ export class FlipperServerImpl implements FlipperServer {
|
||||
}
|
||||
}
|
||||
|
||||
private async createFolders() {
|
||||
await mkdirp(flipperDataFolder);
|
||||
await mkdirp(flipperSettingsFolder);
|
||||
}
|
||||
|
||||
async startDeviceListeners() {
|
||||
const asyncDeviceListenersPromises: Array<Promise<void>> = [];
|
||||
if (this.config.settings.enableAndroid) {
|
||||
|
||||
Reference in New Issue
Block a user