mirror of
https://codeberg.org/spire/nix.git
synced 2026-08-02 12:25:00 +02:00
update script for ambuild
This commit is contained in:
parent
c8615c5aab
commit
f90c30a761
2 changed files with 19 additions and 9 deletions
|
|
@ -1,9 +1,13 @@
|
|||
#! /usr/bin/env nu
|
||||
|
||||
def main [] {
|
||||
update_metamod
|
||||
nix-update --flake --version=branch --build ambuild
|
||||
|
||||
nix-update --flake --version=$"(get_metamod_version)" metamod-source
|
||||
nom build .#metamods.x86_64-linux.tf2
|
||||
|
||||
nix-update --flake --use-update-script sourcemod
|
||||
nom build .#sourcemods.x86_64-linux.tf2
|
||||
|
||||
let sdks = open nix/sourcemod/hl2sdks.json | columns
|
||||
$sdks | each {|sdk| update_sdk $sdk}
|
||||
|
|
@ -20,12 +24,9 @@ def update_sdk [sdk: string] {
|
|||
nix build .#sourcemods.x86_64-linux.tf2
|
||||
}
|
||||
|
||||
def update_metamod [] {
|
||||
def get_metamod_version [] {
|
||||
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
|
||||
$"($branch).0.($build)"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue