1
0
Эх сурвалжийг харах

fix(cli): Fix plugin path detection when only 1 plugin exists

Michael Bromley 1 жил өмнө
parent
commit
4f31067be2

+ 3 - 0
packages/cli/src/commands/add/plugin/create-new-plugin.ts

@@ -195,6 +195,9 @@ function findExistingPluginsDir(project: Project): { prefix: string; suffix: str
     if (pluginClasses.length === 0) {
         return;
     }
+    if (pluginClasses.length === 1) {
+        return { prefix: path.dirname(pluginClasses[0].getSourceFile().getDirectoryPath()), suffix: '' };
+    }
     const pluginDirs = pluginClasses.map(c => {
         return c.getSourceFile().getDirectoryPath();
     });