Fix ShellCheck issues in cleanup scripts 43/53043/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 9 Mar 2017 03:11:46 +0000 (22:11 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 9 Mar 2017 03:59:00 +0000 (22:59 -0500)
Change-Id: I58f020ba7d34d2cfeffaba5a3a30c3c2087e57b2
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/integration/include-raw-integration-cleanup-tmp.sh
jjb/integration/include-raw-integration-cleanup-workspace.sh

index f1e8255f95ea607a1c2c7754e363f8b4d2ecd4c4..f7c12b2fa7236f63b17cc42ebc013751ef863d02 100644 (file)
@@ -1,6 +1,7 @@
+#!/bin/bash
 echo "Cleaning up Robot installation..."
 
 # ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh
 # script.
 # TODO: Is this still needed when we have integration-cleanup-workspace?
-rm -rf ${ROBOT_VENV}
+rm -rf "${ROBOT_VENV}"
index 32c90305bd6169a240363f1f4e0d98f4afa34209..f824262aeb025c56f7692f171b486425bfe25d74 100644 (file)
@@ -1,9 +1,12 @@
+#!/bin/bash
 echo "Cleaning up the workspace..."
 
 # Leftover files from previous runs could be wrongly copied as results.
 # Keep the cloned integration/test repository!
-for file_or_dir in `ls -A -1 -I "test"`
+for file_or_dir in *
 # FIXME: Make this compatible with multipatch and other possible build&run jobs.
 do
-  rm -vrf "$file_or_dir"
+    if [ "$file_or_dir" != "test" ]; then
+        rm -vrf "$file_or_dir"
+    fi
 done