From 4772c77064ad11d31210f8ae7637690a6b42a115 Mon Sep 17 00:00:00 2001 From: shihanwan Date: Thu, 25 Apr 2024 17:15:19 -0400 Subject: [PATCH] fix breaking change --- packages/bumpgen-core/src/services/matching/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/bumpgen-core/src/services/matching/index.ts b/packages/bumpgen-core/src/services/matching/index.ts index bdc641a..ca6aeeb 100644 --- a/packages/bumpgen-core/src/services/matching/index.ts +++ b/packages/bumpgen-core/src/services/matching/index.ts @@ -204,18 +204,15 @@ const searchAndReplace = ( return content; } - const indentedNewCode = formatNewCode( - countIndents(firstMatchedLine), - newCode - ); + const formattedNewCode = formatNewCode(firstMatchedLine, newCode); console.log("=== replacing with this new code") - console.log(indentedNewCode.join("\n")); + console.log(formattedNewCode.join("\n")); console.log("=== \n"); const updatedContents = [ ...splitContent.slice(0, startIndex), - ...indentedNewCode, + ...formattedNewCode, ...splitContent.slice(endIndex + 1) ].join("\n");