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

Quentin Schulz

From: Quentin Schulz <quentin.schulz@...>

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@...>
Signed-off-by: Quentin Schulz <quentin.schulz@...>
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 {} \;

Join yocto@lists.yoctoproject.org to automatically receive all group messages.