Fix ShellCheck issues in cleanup scripts
[releng/builder.git] / jjb / integration / include-raw-integration-cleanup-workspace.sh
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