From 93ff94776c5a86cf25dc3bc8a6846f921869d2ed Mon Sep 17 00:00:00 2001 From: jan Date: Mon, 8 Jan 2024 13:42:33 +0200 Subject: [PATCH] - added sub dir script scan --- public/workflows/index.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/public/workflows/index.php b/public/workflows/index.php index 5db5d15..e174faa 100644 --- a/public/workflows/index.php +++ b/public/workflows/index.php @@ -74,22 +74,13 @@ function returnScriptIndex($tenantDirectory): void { // Initialize an empty array to store the file data $file_data = array(); - - // Search the directory for files ending with '.nox.yaml' - $files = glob($tenantDirectory . '/*.nox.yaml'); - - // Loop through the files - foreach ($files as $file) { - - // Get the file size - $size = filesize($file); - - // Get the SHA checksum of the file - $shaChecksum = hash_file('sha256', $file); - - // Add the file data to the array + $scriptList = scanAllDir($tenantDirectory); + foreach($scriptList as $script) { + $filePath = $tenantDirectory . '/' . $script; + $size = filesize($filePath); + $shaChecksum = hash_file('sha256', $filePath); $file_data[] = [ - 'name' => basename($file), + 'name' => $script, 'size' => $size, 'shaChecksum' => $shaChecksum ];