Import File implementation
Summary: Implementation was missing for the browser. This provides a default implementation. Reviewed By: aigoncharov Differential Revision: D48311198 fbshipit-source-id: fd067600f571234e0fbccfb90853b62f175ff8fb
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2f5f4911e5
commit
ff6f98fc0d
@@ -521,8 +521,11 @@ export class FlipperServerImpl implements FlipperServer {
|
||||
this.pluginManager.downloadPlugin(details),
|
||||
'plugins-get-updatable-plugins': (query) =>
|
||||
this.pluginManager.getUpdatablePlugins(query),
|
||||
'plugins-install-from-file': (path) =>
|
||||
this.pluginManager.installPluginFromFile(path),
|
||||
'plugins-install-from-content': (contents) => {
|
||||
const bytes = Base64.toUint8Array(contents);
|
||||
const buffer = Buffer.from(bytes);
|
||||
return this.pluginManager.installPluginFromFileOrBuffer(buffer);
|
||||
},
|
||||
'plugins-install-from-marketplace': (name: string) =>
|
||||
this.pluginManager.installPluginForMarketplace(name),
|
||||
'plugins-install-from-npm': (name) =>
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
getInstalledPlugins,
|
||||
getPluginVersionInstallationDir,
|
||||
getPluginDirNameFromPackageName,
|
||||
installPluginFromFile,
|
||||
installPluginFromFileOrBuffer,
|
||||
removePlugins,
|
||||
getUpdatablePlugins,
|
||||
getInstalledPlugin,
|
||||
@@ -71,7 +71,7 @@ export class PluginManager {
|
||||
removePlugins = removePlugins;
|
||||
getUpdatablePlugins = getUpdatablePlugins;
|
||||
getInstalledPlugin = getInstalledPlugin;
|
||||
installPluginFromFile = installPluginFromFile;
|
||||
installPluginFromFileOrBuffer = installPluginFromFileOrBuffer;
|
||||
installPluginFromNpm = installPluginFromNpm;
|
||||
|
||||
async loadSource(path: string): Promise<PluginSource> {
|
||||
@@ -186,7 +186,7 @@ export class PluginManager {
|
||||
await new Promise((resolve, reject) =>
|
||||
writeStream.once('finish', resolve).once('error', reject),
|
||||
);
|
||||
return await installPluginFromFile(tmpFile);
|
||||
return await installPluginFromFileOrBuffer(tmpFile);
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
|
||||
Reference in New Issue
Block a user