Skip to content

Commit

Permalink
Merge pull request #63 from NoxOrg/feature/structured-scripts
Browse files Browse the repository at this point in the history
- added sub dir script scan
  • Loading branch information
jan-schutte authored Jan 8, 2024
2 parents fdc251b + 93ff947 commit 1652e8a
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions public/workflows/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
Expand Down

0 comments on commit 1652e8a

Please sign in to comment.