feat(just): add assert utility function/recipe

This commit is contained in:
Chris Kruining 2025-10-30 21:26:18 +01:00
parent b11ca6bd05
commit 138bb67ffb
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
2 changed files with 14 additions and 2 deletions

View file

@ -19,4 +19,15 @@ mod machine '.just/machine.just'
[doc('Introspection on flake output')]
@select key:
nix eval --json .#{{ key }} | jq .
nix eval --json .#{{ key }} | jq .
#===============================================================================================
# Utils
#===============================================================================================
[no-exit-message]
[no-cd]
[private]
@assert condition message:
[ {{ condition }} ] || { echo -e 1>&2 "\n\x1b[1;41m Error \x1b[0m {{ message }}\n"; exit 1; }