From c5b803a75008eb1b7ea885d7f53d0800a443e41f Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 29 Apr 2024 13:00:10 +0800 Subject: [PATCH] fix(pm): parse name --- ...20-rename-plugins.ts => 20240428235620-rename-plugins.ts} | 2 +- packages/core/server/src/plugin-manager/plugin-manager.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename packages/core/server/src/migrations/{20240427235620-rename-plugins.ts => 20240428235620-rename-plugins.ts} (92%) diff --git a/packages/core/server/src/migrations/20240427235620-rename-plugins.ts b/packages/core/server/src/migrations/20240428235620-rename-plugins.ts similarity index 92% rename from packages/core/server/src/migrations/20240427235620-rename-plugins.ts rename to packages/core/server/src/migrations/20240428235620-rename-plugins.ts index fcc295191c..c3dfb2f30d 100644 --- a/packages/core/server/src/migrations/20240427235620-rename-plugins.ts +++ b/packages/core/server/src/migrations/20240428235620-rename-plugins.ts @@ -2,7 +2,7 @@ import { Migration } from '../migration'; export default class extends Migration { on = 'afterSync'; // 'beforeLoad' or 'afterLoad' - appVersion = '<1.0.0-alpha.1'; + appVersion = '<1.0.0-alpha.3'; async up() { const items = await this.pm.repository.find(); diff --git a/packages/core/server/src/plugin-manager/plugin-manager.ts b/packages/core/server/src/plugin-manager/plugin-manager.ts index a8c1931467..938ce3dc8f 100644 --- a/packages/core/server/src/plugin-manager/plugin-manager.ts +++ b/packages/core/server/src/plugin-manager/plugin-manager.ts @@ -530,6 +530,7 @@ export class PluginManager { const toBeUpdated = []; for (const name of pluginNames) { const { name: pluginName } = await PluginManager.parseName(name); + console.log('pluginName', pluginName); const plugin = this.get(pluginName); if (!plugin) { throw new Error(`${pluginName} plugin does not exist`); @@ -822,7 +823,7 @@ export class PluginManager { const { packageName, tempFile, tempPackageContentDir } = await downloadAndUnzipToTempDir(file, authToken); - const name = options.name || packageName; + const { name } = await PluginManager.parseName(packageName); if (this.has(name)) { await removeTmpDir(tempFile, tempPackageContentDir); @@ -857,7 +858,7 @@ export class PluginManager { authToken, ); - const name = options.name || packageName; + const { name } = await PluginManager.parseName(packageName); if (this.has(name)) { await removeTmpDir(tempFile, tempPackageContentDir);