Skip to content

Commit 388216a

Browse files
🐛 Don't replace if comments don't exist
1 parent 1eb7c85 commit 388216a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/replace.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export const replaceContents = (start: string, end: string, readme: string, contents: string) => {
2-
if (!readme.includes(start) || !readme.includes(end))
2+
if (!readme.includes(start) || !readme.includes(end)) {
33
console.log("Starting and ending string not found");
4+
return readme;
5+
}
46

57
const startString = readme.split(start)[0];
68
const endString = readme.split(end)[1];

0 commit comments

Comments
 (0)