Fix the issue with plugin installation from npm
Summary: https://github.com/facebook/flipper/issues/1818 Reviewed By: jknoxville Differential Revision: D25870562 fbshipit-source-id: 0d62626355b35505089990cfdb592b0ea4b84fda
This commit is contained in:
committed by
Facebook GitHub Bot
parent
731e39445f
commit
a6599963ec
@@ -147,6 +147,12 @@ describe('pluginInstaller', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test('getInstalledPlugins when no plugins installed', async () => {
|
||||
await fs.remove(pluginInstallationDir);
|
||||
const plugins = await getInstalledPlugins();
|
||||
expect(plugins).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('moveInstalledPluginsFromLegacyDir', async () => {
|
||||
await moveInstalledPluginsFromLegacyDir();
|
||||
expect(
|
||||
|
||||
@@ -215,6 +215,9 @@ type InstalledPluginVersionDirs = [string, string[]][];
|
||||
async function getInstalledPluginVersionDirs(): Promise<
|
||||
InstalledPluginVersionDirs
|
||||
> {
|
||||
if (!(await fs.pathExists(pluginInstallationDir))) {
|
||||
return [];
|
||||
}
|
||||
return await fs
|
||||
.readdir(pluginInstallationDir)
|
||||
.then((dirs) => dirs.map((dir) => path.join(pluginInstallationDir, dir)))
|
||||
|
||||
Reference in New Issue
Block a user