From d63035e13d9234fd18dd2ffde29309ffb9a1255c Mon Sep 17 00:00:00 2001 From: Frank Kloeker Date: Sun, 21 Apr 2019 00:09:37 +0200 Subject: [PATCH] Prevent InvocationError on non-existent files exit code for the function will be 1 if the previous command failed if/then condition intercepts that Change-Id: Icf43e72c65e6c63d95aef8d289b689a200d1eaeb --- bin/docstheme-build-translated.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/docstheme-build-translated.sh b/bin/docstheme-build-translated.sh index c0f4d9b6..246e4e6a 100755 --- a/bin/docstheme-build-translated.sh +++ b/bin/docstheme-build-translated.sh @@ -112,10 +112,13 @@ function add_language_index_to_original { function recover_rst_files { for f in `find $DIRECTORY/source -name '*.rst'`; do - [ -f $f.backup ] && mv $f.backup $f + if [ -f $f.backup ]; then + mv $f.backup $f + fi done } + function remove_pot_files { # remove newly created pot files rm -f ${DIRECTORY}/source/locale/*.pot