nixpkgs/pkgs/by-name/ov/ovn/update.nu

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
747 B
Plaintext
Raw Normal View History

2023-12-21 16:08:12 +00:00
#!/usr/bin/env nix-shell
#!nix-shell -i nu -p nushell common-updater-scripts
def main [--lts = false, --regex: string] {
2023-12-21 16:08:12 +00:00
let tags = list-git-tags --url=https://github.com/ovn-org/ovn | lines | sort --natural | str replace v ''
let latest_tag = if $regex == null { $tags } else { $tags | find --regex $regex } | last
let current_version = nix eval --raw -f default.nix $"ovn(if $lts {"-lts"}).version" | str trim
if $latest_tag != $current_version {
if $lts {
update-source-version ovn-lts $latest_tag $"--file=(pwd)/pkgs/by-name/ov/ovn/lts.nix"
} else {
update-source-version ovn $latest_tag $"--file=(pwd)/pkgs/by-name/ov/ovn/package.nix"
}
}
{"lts?": $lts, before: $current_version, after: $latest_tag}
}