Fix Flipper lints #12
Reviewed By: timur-valiev Differential Revision: D31932981 fbshipit-source-id: 4cf905495494466462c0494116f56cd16773e549
This commit is contained in:
committed by
Facebook GitHub Bot
parent
898cadad2d
commit
1b5cd3d2d5
@@ -7,6 +7,8 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-disable node/no-sync */
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import {
|
import {
|
||||||
getInstalledPlugins,
|
getInstalledPlugins,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ async function entryPointForPluginFolder(
|
|||||||
pluginsDir: string,
|
pluginsDir: string,
|
||||||
): Promise<{[key: string]: InstalledPluginDetails}> {
|
): Promise<{[key: string]: InstalledPluginDetails}> {
|
||||||
pluginsDir = expandTilde(pluginsDir);
|
pluginsDir = expandTilde(pluginsDir);
|
||||||
if (!fs.existsSync(pluginsDir)) {
|
if (!(await fs.pathExists(pluginsDir))) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return await fs
|
return await fs
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Heavy use of nested promises but without sacrificing error propagation.
|
||||||
|
/* eslint-disable promise/no-nesting */
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import {promisify} from 'util';
|
import {promisify} from 'util';
|
||||||
@@ -205,7 +208,7 @@ export async function moveInstalledPluginsFromLegacyDir() {
|
|||||||
`Failed to load plugin from ${dir} on moving legacy plugins. Removing it.`,
|
`Failed to load plugin from ${dir} on moving legacy plugins. Removing it.`,
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
fs.remove(dir);
|
await fs.remove(dir);
|
||||||
return null;
|
return null;
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export async function getPluginSourceFolders(): Promise<string[]> {
|
|||||||
}
|
}
|
||||||
pluginFolders.push(path.resolve(__dirname, '..', '..', 'plugins', 'public'));
|
pluginFolders.push(path.resolve(__dirname, '..', '..', 'plugins', 'public'));
|
||||||
pluginFolders.push(path.resolve(__dirname, '..', '..', 'plugins', 'fb'));
|
pluginFolders.push(path.resolve(__dirname, '..', '..', 'plugins', 'fb'));
|
||||||
return pluginFolders.map(expandTilde).filter(fs.existsSync);
|
return pluginFolders.map(expandTilde).filter(async (f) => fs.pathExists(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPluginInstallationDir(name: string) {
|
export function getPluginInstallationDir(name: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user