Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async initialize(): Promise {
this.pluginReader.getPluginMetadata(process.env.HOSTED_PLUGIN)
.then(this.hostedPlugin.resolve.bind(this.hostedPlugin));
const pluginPath = process.env.HOSTED_PLUGIN;
if (pluginPath) {
const hostedPlugin = new PluginDeployerEntryImpl('Hosted Plugin', pluginPath!, pluginPath);
const hostedMetadata = await this.hostedPlugin.promise;
if (hostedMetadata!.model.entryPoint && hostedMetadata!.model.entryPoint.backend) {
this.deployerHandler.deployBackendPlugins([hostedPlugin]);
}
if (hostedMetadata!.model.entryPoint && hostedMetadata!.model.entryPoint.frontend) {
this.deployerHandler.deployFrontendPlugins([hostedPlugin]);
}
}
}