Skip to content

Commit 007f3b7

Browse files
committed
chore: update regex
1 parent 08406f3 commit 007f3b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/scripts/src/commands/version.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ async function updateConfigTS(tsPath: string, newVersion: string) {
114114
});
115115
}
116116
// use regex to capture content_tag both inline and nested. E.g.
117-
// `git: {config_tag_latest: "1.2.3"}` or `git.config_tag_latest = 1.2.3`
117+
// `git: {config_tag_latest: "1.2.3"}` or `git.config_tag_latest = "1.2.3"`
118118
// and keep existing formatting (just replace matched version code between quotation marks)
119-
const regex = /(content_tag_latest.*)"(.*)"/g;
119+
const regex = /(content_tag_latest.*)['"](.*)['"]/g;
120120
const replaced = configStr.replace(regex, "$1" + '"' + newVersion + '"');
121121
writeFileSync(tsPath, replaced);
122122
// TODO - recompile config

0 commit comments

Comments
 (0)