mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:25:52 +00:00
fix(server): parse plugin name
This commit is contained in:
parent
8afe119ac9
commit
61338eedb7
@ -307,22 +307,17 @@ export class PluginManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.app.log.info('attempt to add the plugin to the app');
|
this.app.log.info('attempt to add the plugin to the app');
|
||||||
let packageName: string;
|
const { name, packageName } = await PluginManager.parseName(pluginName);
|
||||||
try {
|
|
||||||
packageName = await PluginManager.getPackageName(pluginName);
|
|
||||||
} catch (error) {
|
|
||||||
packageName = pluginName;
|
|
||||||
}
|
|
||||||
const json = await PluginManager.getPackageJson(packageName);
|
const json = await PluginManager.getPackageJson(packageName);
|
||||||
this.app.log.info(`add plugin [${packageName}]`, {
|
this.app.log.info(`add plugin [${packageName}]`, {
|
||||||
name: pluginName,
|
name,
|
||||||
packageName: packageName,
|
packageName,
|
||||||
version: json.version,
|
version: json.version,
|
||||||
});
|
});
|
||||||
await this.repository.updateOrCreate({
|
await this.repository.updateOrCreate({
|
||||||
values: {
|
values: {
|
||||||
name: pluginName,
|
name,
|
||||||
packageName: packageName,
|
packageName,
|
||||||
version: json.version,
|
version: json.version,
|
||||||
},
|
},
|
||||||
filterKeys: ['name'],
|
filterKeys: ['name'],
|
||||||
|
Loading…
Reference in New Issue
Block a user