Skip to content

Commit e62bb75

Browse files
committed
fix: add early return for empty patches in generateApplyPatchesCommand to prevent unnecessary command execution
1 parent 4af0bdc commit e62bb75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/server/src/services/patch.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ export const generateApplyPatchesCommand = async ({
149149
const resultPatches = await findPatchesByEntityId(id, type);
150150
const patches = resultPatches.filter((p) => p.enabled);
151151

152+
if (patches.length === 0) {
153+
return "";
154+
}
155+
152156
let command = `echo "Applying ${patches.length} patch(es)...";`;
153157

154158
for (const p of patches) {

0 commit comments

Comments
 (0)