Don't try restoring a file if no backup is available
This caused `all.sh --force` to fail on a clean build tree.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 4705fe8..f38657d 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -303,7 +303,9 @@
# Restore files that may have been clobbered by the job
for x in $files_to_back_up; do
- cp -p "$x$backup_suffix" "$x"
+ if [[ -e "$x$backup_suffix" ]]; then
+ cp -p "$x$backup_suffix" "$x"
+ fi
done
}