Skip to content

Commit

Permalink
readme should now include if the addon has autoupdate url
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Aug 19, 2024
1 parent ac6afd3 commit dd8fc70
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions generate-readme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -19,6 +19,7 @@ foreach ($file in $userJsFiles) {

$i = 0
$endOfCommentBlock = $false
$autoUpdate = $false
$name = ""
$description = ""

Expand All @@ -33,6 +34,8 @@ foreach ($file in $userJsFiles) {
$name = $value
} elseif ($key -eq 'description') {
$description = $value
} elseif ($key -eq 'updateURL') {
$autoUpdate = $true
}
}

Expand All @@ -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 $_ }
Expand Down

0 comments on commit dd8fc70

Please sign in to comment.