update script for metamod-source

This commit is contained in:
Robin Appelman 2026-07-08 22:05:52 +02:00
commit 1db5e3a001
4 changed files with 21 additions and 9 deletions

View file

@ -1,8 +1,10 @@
#! /usr/bin/env nu
def main [] {
let sdks = open nix/sourcemod/hl2sdks.json | columns
$sdks | each {|sdk| update_sdk $sdk}
update_metamod
# let sdks = open nix/sourcemod/hl2sdks.json | columns
# $sdks | each {|sdk| update_sdk $sdk}
}
def update_sdk [sdk: string] {
@ -15,3 +17,13 @@ def update_sdk [sdk: string] {
nix-update --flake --use-update-script $"hl2sdk.($sdk)"
nix build .#sourcemods.x86_64-linux.tf2
}
def update_metamod [] {
let html = http get https://www.metamodsource.net/downloads.php/?branch=stable
let branch = $html | query web --query h3 | first | first | parse --regex "from (?P<branch>[0-9.]+) Branch" | get branch | first
let build = $html | query web --as-table [Build] | get Build | first
print $"Updating metamod-source to ($branch).0.($build)"
nix-update --flake --version=$"($branch).0.($build)" metamod-source
nom build .#metamods.x86_64-linux.tf2
}