Skip to content

Commit

Permalink
fix(cli): Fix api extension location detection
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Apr 29, 2024
1 parent 64b9c60 commit a5fdd86
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,12 @@ function getGraphQLType(type: Type): string | undefined {

function getOrCreateApiExtensionsFile(project: Project, plugin: VendurePluginRef): SourceFile {
const existingApiExtensionsFile = project.getSourceFiles().find(sf => {
return sf.getBaseName() === 'api-extensions.ts' && sf.getDirectory().getPath().endsWith('/api');
const filePath = sf.getDirectory().getPath();
return (
sf.getBaseName() === 'api-extensions.ts' &&
filePath.includes(plugin.getPluginDir().getPath()) &&
filePath.endsWith('/api')
);
});
if (existingApiExtensionsFile) {
return existingApiExtensionsFile;
Expand Down

0 comments on commit a5fdd86

Please sign in to comment.