diff --git a/generate-readme.ps1 b/generate-readme.ps1 index a657981..d8ab03a 100644 --- a/generate-readme.ps1 +++ b/generate-readme.ps1 @@ -6,6 +6,9 @@ $userJsFiles = Get-ChildItem -Path $UserScripts -Filter "*.user.js" | Sort-Objec $regEx = [regex]'\/\/\s+@(\w+)\s+(.+)' + +$scriptList = @() + # Initialize an array to hold the table rows $tableRows = @() @@ -20,7 +23,10 @@ foreach ($file in $userJsFiles) { $i = 0 $endOfCommentBlock = $false $autoUpdate = $false - $name = "" + $name = $file.Name + $version = "Beta" + $author = "" + $match = "" $description = "" do { @@ -36,6 +42,12 @@ foreach ($file in $userJsFiles) { $description = $value } elseif ($key -eq 'updateURL') { $autoUpdate = $true + } elseif ($key -eq 'version') { + $version = $value + } elseif ($key -eq 'author') { + $author = $value + } elseif ($key -eq 'match') { + $match = $value } } @@ -46,13 +58,26 @@ foreach ($file in $userJsFiles) { $i++ } while (($i -lt $content.Length) -and (-not $endOfCommentBlock)) + $endOfCommentBlock = $false + if ($autoUpdate) { $autoUpdateText = "✅" } else { $autoUpdateText = "" } + $scriptList += " ## $name`n`n" + $scriptList += "
| Version | $version |
|---|---|
| Author | $author |
| Match | $match |
| Description | $description |