From 32a20ae990a1a98c251128d96a114d2c6d371175 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 18 Jul 2017 16:57:08 -0400 Subject: [PATCH] make the test script smarter about its output directory If we ran "tox -e publishdocs" locally, there won't be a publish-docs/www/ directory and we don't want to create one when the template test script is run. Have it check the existing directories to derive where it should write its output. Change-Id: I4ee8495bc0fb8c6a59424332d498956ea7e7e870 Signed-off-by: Doug Hellmann --- tools/test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index 7033b2f85d..2241d0df98 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -1,10 +1,16 @@ #!/bin/bash -xe +if [[ -d publish-docs/www/ ]]; then + output=publish-docs/www +else + output=publish-docs/ +fi + .tox/checkbuild/bin/python tools/www-generator.py --verbose --source-directory www/ \ - --output-directory publish-docs/www/ $@ + --output-directory $output $@ if [[ $? -eq 0 ]]; then - rsync -a www/static/ publish-docs/www/ + rsync -a www/static/ $output fi # publish-docs/www-index.html is the trigger for openstack-indexpage # to include the file.