From dd8fc704ece534d537fe6e22807ccf91184ed5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Andreas=20Nilsen?= Date: Mon, 19 Aug 2024 12:32:26 +0200 Subject: [PATCH] readme should now include if the addon has autoupdate url --- generate-readme.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/generate-readme.ps1 b/generate-readme.ps1 index 3626392..1a01bdc 100644 --- a/generate-readme.ps1 +++ b/generate-readme.ps1 @@ -9,8 +9,8 @@ $regEx = [regex]'\/\/\s+@(\w+)\s+(.+)' # Initialize an array to hold the table rows $tableRows = @() -$tableRows = "`n| Filename | Name | Description |`n" -$tableRows += "|----------|------|-------------|`n" +$tableRows = "`n| Filename | Name | Description | Auto Update |`n" +$tableRows += "|----------|------|-------------|-------------|`n" # Loop through each file foreach ($file in $userJsFiles) { @@ -19,6 +19,7 @@ foreach ($file in $userJsFiles) { $i = 0 $endOfCommentBlock = $false + $autoUpdate = $false $name = "" $description = "" @@ -33,6 +34,8 @@ foreach ($file in $userJsFiles) { $name = $value } elseif ($key -eq 'description') { $description = $value + } elseif ($key -eq 'updateURL') { + $autoUpdate = $true } } @@ -44,9 +47,14 @@ foreach ($file in $userJsFiles) { $i++ } while (($i -lt $content.Length) -and (-not $endOfCommentBlock)) $endOfCommentBlock = $false - + if ($autoUpdate) { + $autoUpdateText = "✅" + } else { + $autoUpdateText = "" + } + # Add the row to the table - $tableRows += "| [$($file.Name)](https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/$($file.Name)) | $name | $description |`n" + $tableRows += "| [$($file.Name)](https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/$($file.Name)) | $name | $description | $autoUpdateText |`n" } #$tableRows | ForEach-Object { Write-Output $_ }