[RFC,yocto-autobuilder-helper,6/6] scripts: run-docs-build: reuse logic to link to latest tag

Message ID 20220419170730.124287-7-foss+yocto@0leil.net
State New
Headers show
Series [RFC] docs: update Bitbake objects.inv location for master branch | expand

Commit Message

Quentin Schulz April 19, 2022, 5:07 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Since the latest tag already has a specific handling in the forloop,
let's just move the symlink creation inside the forloop.

Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
 scripts/run-docs-build | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)


diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index faba0fe..ecc5332 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -142,6 +142,8 @@  for branch in dunfell $(git branch --remote --contains "$first_sphinx_commit" --
         mkdir $outputdir/$latest_tag
         cp -r ./_build/final/* $outputdir/$latest_tag
+        echo Linking to $latest_tag as current
+        ln -s $latest_tag $outputdir/current
     elif [ "$branch" = "transition" ]; then
@@ -153,11 +155,6 @@  for branch in dunfell $(git branch --remote --contains "$first_sphinx_commit" --
     git clean -f
-# get current release (e.g. most recent tag), and add a 'current' link
-tag=$(git tag --list 'yocto-*' | sort --version-sort | tail -1 | cut -c7-)
-echo Linking to $tag as current
-ln -s $tag $outputdir/current
 # Update bitbake switchers.js with the copy from master ypdocs
 cd $outputdir/bitbake
 find . -name switchers.js -exec cp $outputdir/current/_static/switchers.js {} \;