diff --git a/generate-readme.ps1 b/generate-readme.ps1 index 6e53b21..4490822 100644 --- a/generate-readme.ps1 +++ b/generate-readme.ps1 @@ -20,6 +20,7 @@ foreach ($file in $userJsFiles) { $version = "Beta" $author = "" $match = "" + $exclude = "" $description = "" do { @@ -40,7 +41,17 @@ foreach ($file in $userJsFiles) { } elseif ($key -eq 'author') { $author = $value } elseif ($key -eq 'match') { - $match = $value + if ($match -eq "") { + $match = $value + } else { + $match += "`n$value" + } + } elseif ($key -eq 'exclude') { + if ($exclude -eq "") { + $exclude = $value + } else { + $exclude += "`n$value" + } } } @@ -61,7 +72,25 @@ foreach ($file in $userJsFiles) { if ($author) { $scriptList += "`n - **Author:** $author`n" } - $scriptList += " - **Match:** ``$match```n" + $all_match = $match -split "`n" + if ($all_match.count -eq 1) { + $scriptList += " - **Match:** ``$match```n" + } else { + $scriptList += " - **Match:**`n" + foreach ($m in $all_match) { + $scriptList += " - ``$m```n" + } + } + $all_exclude = $exclude -split "`n" + if (($exclude -ne "") -and ($all_exclude.count -eq 1)) { + $scriptList += " - **Exclude:** ``$exclude```n" + } elseif ($all_exclude.count -gt 1) { + $scriptList += " - **Exclude:**`n" + foreach ($e in $all_exclude) { + $scriptList += " - ``$e```n" + } + } + #$scriptList += " - **Match:** ``$match```n" $scriptList += " - **Description:** $description`n" $baseName = $file.Name -replace '\.user\.js$', ''