Fix bug when publishing maintenance release docs
Change-Id: Ibc8d855eca2fe66be9e0c9f8547132a03151c41a
diff --git a/tools/build/onos-upload-docs b/tools/build/onos-upload-docs
index 1dc750a..5c311a3 100755
--- a/tools/build/onos-upload-docs
+++ b/tools/build/onos-upload-docs
@@ -25,10 +25,11 @@
ONOS_VERSION_SPLIT=(${ONOS_VERSION_STRING//\./ })
if (( ${ONOS_VERSION_SPLIT[1]} >= ${CURRENT_VERSION_SPLIT[1]} )); then
+ replace="1"
echo "Should replace current version $CURRENT_VERSION_STRING with new ONOS version $ONOS_VERSION_STRING"
else
echo "Not replacing current version $CURRENT_VERSION_STRING with ONOS version $ONOS_VERSION_STRING"
- exit 0
+ replace="0"
fi
scp $docs $remote:/tmp/onos-apidocs-$ONOS_VERSION.tar.gz
@@ -40,5 +41,7 @@
#rm -rf onos-apidocs-$ONOS_VERSION
# bump /var/www/api/index.html
- sed -i -E 's#/[^/]+/#/$ONOS_VERSION/#g' /var/www/api/index.html
+ if [ "$replace" == "1" ]; then
+ sed -i -E 's#/[^/]+/#/$ONOS_VERSION/#g' /var/www/api/index.html
+ fi
"