Skip to content

Commit

Permalink
fix: resolve some type errors (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Jan 6, 2025
1 parent 50489be commit cc36960
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default defineNuxtModule<PrismaExtendedModule>({

const PRISMA_SCHEMA_CMD = [
"--schema",
options.prismaSchemaPath || resolvedPrismaSchema,
options.prismaSchemaPath || resolvedPrismaSchema || "",
];

// Ensure Prisma CLI is installed if required
Expand All @@ -151,7 +151,7 @@ export default defineNuxtModule<PrismaExtendedModule>({
try {
await ensureDependencyInstalled("prisma", {
cwd: PROJECT_PATH,
dev: true
dev: true,
});
log(PREDEFINED_LOG_MESSAGES.installPrismaCLI.success);
} catch (error) {
Expand Down Expand Up @@ -209,7 +209,10 @@ export default defineNuxtModule<PrismaExtendedModule>({
rootDir: PROJECT_PATH,
provider: "sqlite",
});
await writeToSchema(resolvedPrismaSchema);

if (resolvedPrismaSchema) {
await writeToSchema(resolvedPrismaSchema);
}
};

/**
Expand Down Expand Up @@ -252,7 +255,7 @@ export default defineNuxtModule<PrismaExtendedModule>({
if (options.generateClient) {
if (options.installClient) {
await ensureDependencyInstalled("@prisma/client", {
cwd: PROJECT_PATH
cwd: PROJECT_PATH,
});
}
await generatePrismaClient(
Expand Down

0 comments on commit cc36960

Please sign in to comment.