Plugin Marketplace API
Summary: Extracted plugin marketplace API to a separate file and updated it to load full plugin manifests. Reviewed By: passy Differential Revision: D25181759 fbshipit-source-id: a63f9ce16249ccc170df148cef5c209fdc6d4d6d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
658b3e8a91
commit
5b26f36672
@@ -12,7 +12,7 @@ import {homedir} from 'os';
|
||||
import fs from 'fs-extra';
|
||||
import expandTilde from 'expand-tilde';
|
||||
|
||||
export const flipperDataDir = path.join(homedir(), '.flipper');
|
||||
const flipperDataDir = path.join(homedir(), '.flipper');
|
||||
|
||||
export const pluginInstallationDir = path.join(flipperDataDir, 'thirdparty');
|
||||
|
||||
@@ -42,3 +42,28 @@ export async function getPluginSourceFolders(): Promise<string[]> {
|
||||
pluginFolders.push(path.resolve(__dirname, '..', '..', 'plugins', 'fb'));
|
||||
return pluginFolders.map(expandTilde).filter(fs.existsSync);
|
||||
}
|
||||
|
||||
export function getPluginPendingInstallationDir(
|
||||
name: string,
|
||||
version: string,
|
||||
): string {
|
||||
return path.join(getPluginPendingInstallationsDir(name), version);
|
||||
}
|
||||
|
||||
export function getPluginPendingInstallationsDir(name: string): string {
|
||||
return path.join(
|
||||
pluginPendingInstallationDir,
|
||||
getPluginDirNameFromPackageName(name),
|
||||
);
|
||||
}
|
||||
|
||||
export function getPluginInstallationDir(name: string): string {
|
||||
return path.join(
|
||||
pluginInstallationDir,
|
||||
getPluginDirNameFromPackageName(name),
|
||||
);
|
||||
}
|
||||
|
||||
export function getPluginDirNameFromPackageName(name: string) {
|
||||
return name.replace('/', '__');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user