From 2c1db980590265a2b13e15798a7ed37d8128ca0d Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Fri, 10 Dec 2021 18:53:39 +0000 Subject: [PATCH] Set IFS only locally for read in deploy_documentation_tags.sh (#1378) * Set IFS only locally for read Previously IFS was set for the whole bash setting, which later affected the word splitting when the secrets were read from the variables and split into the openssl command. This also tidies up the array reading - previously, the `VERSION` variable was an array (so `echo $VERSION` would be equivalent to `echo ${VERSION[0]}`), and it was passed to `cut`, which isn't necessary, since it was already split. * Include major.minor versioning in path --- tools/deploy_documentation_tag.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/deploy_documentation_tag.sh b/tools/deploy_documentation_tag.sh index ada9abf37e1f..b535af24574c 100755 --- a/tools/deploy_documentation_tag.sh +++ b/tools/deploy_documentation_tag.sh @@ -24,9 +24,8 @@ echo "show current dir: " pwd CURRENT_TAG=`git describe --abbrev=0` -IFS='.' -read -ra VERSION <<< "$CURRENT_TAG" -STABLE_VERSION=`echo $VERSION | cut -d "." -f -2` +IFS=. read -ra VERSION <<< "$CURRENT_TAG" +STABLE_VERSION="${VERSION[0]}.${VERSION[1]}" # Build the documentation. tox -edocs -- -D content_prefix=documentation/stable/"$STABLE_VERSION" -j auto