mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 06:29:25 +08:00
* chore(gateway): refresh message in websocket * chore(gateway): throw error when cli error * chore(gateway): await ipc server response * chore: notification message * fix: build * chore: notification type * feat: notification --------- Co-authored-by: chenos <chenlinxh@gmail.com>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import Application from '../application';
|
|
import { PluginCommandError } from '../errors/plugin-command-error';
|
|
|
|
export default (app: Application) => {
|
|
const pm = app.command('pm');
|
|
|
|
pm.command('create')
|
|
.arguments('plugin')
|
|
.action(async (plugin) => {
|
|
await app.pm.create(plugin);
|
|
});
|
|
|
|
pm.command('add')
|
|
.arguments('plugin')
|
|
.action(async (plugin) => {
|
|
await app.pm.add(plugin, {}, true);
|
|
});
|
|
|
|
pm.command('enable')
|
|
.arguments('<plugins...>')
|
|
.action(async (plugins) => {
|
|
try {
|
|
await app.pm.enable(plugins);
|
|
} catch (error) {
|
|
throw new PluginCommandError(`Failed to enable plugin: ${error.message}`);
|
|
}
|
|
});
|
|
|
|
pm.command('disable')
|
|
.arguments('<plugins...>')
|
|
.action(async (plugins) => {
|
|
try {
|
|
await app.pm.disable(plugins);
|
|
} catch (error) {
|
|
throw new PluginCommandError(`Failed to disable plugin: ${error.message}`);
|
|
}
|
|
});
|
|
|
|
pm.command('remove')
|
|
.arguments('<plugins...>')
|
|
.action(async (plugins) => {
|
|
await app.pm.remove(plugins);
|
|
});
|
|
};
|