Skip to content

Commit

Permalink
Readme generator now sorts scripts after @name instead of filename
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Sep 24, 2025
1 parent 1726fba commit 24c6f1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion generate-readme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
$UserScripts = "."

# Get all .user.js files in the specified directory
$userJsFiles = Get-ChildItem -Path $UserScripts -Filter "*.user.js" | Sort-Object Name
#$userJsFiles = Get-ChildItem -Path $UserScripts -Filter "*.user.js" | Sort-Object Name
$userJsFiles = Get-ChildItem -Path $UserScripts -Filter "*.user.js" | Select-Object fullname, name, @{ Name = 'NameTag'; Expression = { $name_tag = ([regex]"@name\s+(.+)").Match((Get-Content $_.fullname -Raw)).Groups[1].value; if ($name_tag -eq "") { $_.name} else { $name_tag } }} | sort NameTag


$regEx = [regex]'\/\/\s+@(\w+)\s+(.+)'

Expand Down

0 comments on commit 24c6f1d

Please sign in to comment.