You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-24 23:26:50 +02:00
Desktop: Add support for searching and installing plugins from repository
This commit is contained in:
@ -7,6 +7,7 @@ import shim from '../../shim';
|
||||
import { filename, dirname, rtrimSlashes } from '../../path-utils';
|
||||
import Setting from '../../models/Setting';
|
||||
import Logger from '../../Logger';
|
||||
import RepositoryApi from './RepositoryApi';
|
||||
const compareVersions = require('compare-versions');
|
||||
const uslug = require('uslug');
|
||||
const md5File = require('md5-file/promise');
|
||||
@ -328,6 +329,13 @@ export default class PluginService extends BaseService {
|
||||
return this.runner_.run(plugin, pluginApi);
|
||||
}
|
||||
|
||||
public async installPluginFromRepo(repoApi: RepositoryApi, pluginId: string): Promise<Plugin> {
|
||||
const pluginPath = await repoApi.downloadPlugin(pluginId);
|
||||
const plugin = await this.installPlugin(pluginPath);
|
||||
await shim.fsDriver().remove(pluginPath);
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public async installPlugin(jplPath: string): Promise<Plugin> {
|
||||
logger.info(`Installing plugin: "${jplPath}"`);
|
||||
|
||||
|
Reference in New Issue
Block a user