Do not commit if only execute SQL queries (#446)

Fixes #438
This commit is contained in:
Will Chen
2025-06-19 09:21:37 -07:00
committed by GitHub
parent 897d2e522c
commit b4d5f211f7

View File

@@ -228,6 +228,7 @@ export async function processFullResponseActions(
const dyadExecuteSqlQueries = chatWithApp.app.supabaseProjectId const dyadExecuteSqlQueries = chatWithApp.app.supabaseProjectId
? getDyadExecuteSqlTags(fullResponse) ? getDyadExecuteSqlTags(fullResponse)
: []; : [];
let writtenSqlMigrationFiles = 0;
const message = await db.query.messages.findFirst({ const message = await db.query.messages.findFirst({
where: and( where: and(
@@ -259,6 +260,7 @@ export async function processFullResponseActions(
query.content, query.content,
query.description, query.description,
); );
writtenSqlMigrationFiles++;
} catch (error) { } catch (error) {
errors.push({ errors.push({
message: `Failed to write SQL migration file for: ${query.description}`, message: `Failed to write SQL migration file for: ${query.description}`,
@@ -445,7 +447,7 @@ export async function processFullResponseActions(
renamedFiles.length > 0 || renamedFiles.length > 0 ||
deletedFiles.length > 0 || deletedFiles.length > 0 ||
dyadAddDependencyPackages.length > 0 || dyadAddDependencyPackages.length > 0 ||
dyadExecuteSqlQueries.length > 0; writtenSqlMigrationFiles > 0;
let uncommittedFiles: string[] = []; let uncommittedFiles: string[] = [];
let extraFilesError: string | undefined; let extraFilesError: string | undefined;