From 7427a1d2c7f679005d689e6e1500bc2dc7e94485 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 28 Jan 2022 14:58:40 +0100 Subject: [PATCH] scripts/assemble-manifest: gracefully skip tag redirect Co-authored-by: blam Co-authored-by: Johan Haals Signed-off-by: Patrik Oldsberg --- scripts/assemble-manifest.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/assemble-manifest.js b/scripts/assemble-manifest.js index 03b6f51516..f68a83447d 100755 --- a/scripts/assemble-manifest.js +++ b/scripts/assemble-manifest.js @@ -58,6 +58,8 @@ async function main() { ); const tag = version.includes('next') ? 'next' : 'main'; const tagPath = path.resolve('versions', 'v1', 'tags', tag); + + // Check if there's an existing version for the tag, and that it's not newer than the one we're adding if (await fs.pathExists(tagPath)) { const currentTag = await fs.readJSON( path.resolve(tagPath, 'manifest.json'), @@ -66,9 +68,11 @@ async function main() { console.log( `Skipping update of ${tagPath} since current current ${tag} version is ${currentTag.releaseVersion}`, ); - process.exit(1); + return; } } + + // Switch the tag to our new version await fs.remove(tagPath); await fs.ensureSymlink(path.join('..', 'releases', version), tagPath); }