2023-09-15 00:51:11 +00:00
|
|
|
#!/usr/bin/env nu
|
|
|
|
|
2023-08-23 01:41:24 +00:00
|
|
|
let re = '(?s)pname = "(?P<name>[^"]+)".+version = "(?P<version>[^"]+)".+homepage = "(?P<homepage>[^"]+)"'
|
|
|
|
let pkgs = glob pkgs/*
|
|
|
|
| each { |it| open --raw $"($it)/default.nix" | parse --regex $re }
|
|
|
|
| each { |it| { name: $it.name.0, homepage: $it.homepage.0, version: $it.version.0 } }
|
|
|
|
| sort-by name
|
|
|
|
|
|
|
|
# Output
|
|
|
|
$'# jolheiser NUR
|
|
|
|
|
|
|
|
|Package|Version|
|
|
|
|
|-------|-------|
|
|
|
|
($pkgs | each { |it| $"|[($it.name)]\(($it.homepage)\)|`($it.version)`|" } | str join "\n" )
|
|
|
|
'
|