Skip to content

Commit

Permalink
fix breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
shihanwan committed Apr 26, 2024
1 parent 887eb68 commit 325eb86
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/bumpgen-core/src/services/matching/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,16 @@ export 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("=== replacing with this new code")
console.log(formattedNewCode.join("\n"));
console.log("=== \n");

const updatedContents = [
...splitContent.slice(0, startIndex),
...indentedNewCode,
...splitContent.slice(endIndex + 1),
...formattedNewCode,
...splitContent.slice(endIndex + 1)
].join("\n");

return updatedContents;
Expand Down

0 comments on commit 325eb86

Please sign in to comment.