Skip to content

Commit 7e53de2

Browse files
committed
Fix update-docs-branch.js
1 parent 5407d10 commit 7e53de2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/update-docs-branch.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ if (pkgVersion.includes('-') && !pkgVersion.includes('.0.0-')) {
3232
}
3333

3434
const current = match.groups;
35-
const docsBranch = `docs-v${current?.major ?? pkgVersion.split('.')[0]}.x`;
35+
const major = current?.major ?? pkgVersion.split('.')[0];
36+
const docsBranch = `docs-v${major}.x`;
3637

3738
// Fetch remotes and find the docs branch if it exists
3839
run('git fetch --all --no-tags');
@@ -52,7 +53,7 @@ if (!matchingDocsBranches) {
5253
}
5354
const publishedVersion = JSON.parse(read(`git show ${publishedRef}:package.json`)).version;
5455
const publishedMinor = publishedVersion.match(/\d+\.(?<minor>\d+)\.\d+/).groups.minor;
55-
if (current.minor < publishedMinor) {
56+
if (major < publishedMinor) {
5657
console.error('Refusing to update docs: newer version is published');
5758
process.exit(0);
5859
}

0 commit comments

Comments
 (0)