feat: improve justfiles

This commit is contained in:
Chris Kruining 2025-12-08 16:31:52 +01:00
parent eab9e8b58d
commit 3730ab856b
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
3 changed files with 39 additions and 34 deletions

View file

@ -1,33 +1,40 @@
@_default:
just --list --list-submodules
_default:
just --list --list-submodules
set unstable
set quiet
[doc('Manage vars')]
mod vars '.just/vars.just'
[doc('Manage machines')]
mod machine '.just/machine.just'
[doc('Show information about project')]
@show:
echo "show"
show:
echo "show"
[doc('update the flake dependencies')]
@update:
nix flake update
git commit -m 'chore: update dependencies' -- ./flake.lock > /dev/null
echo "Done"
update:
nix flake update
git commit -m 'chore: update dependencies' -- ./flake.lock > /dev/null
echo "Done"
[doc('Rebase branch on main')]
rebase:
git stash -q \
&& git fetch \
&& git rebase origin/main \
&& git stash pop -q
echo "Done"
[doc('Introspection on flake output')]
@select key:
nix eval --show-trace --json .#{{ key }} | jq .
select key:
nix eval --json .#{{ key }} | jq .
#===============================================================================================
# Utils
#===============================================================================================
[no-exit-message]
# ===============================================================================================
[no-cd]
[no-exit-message]
[private]
@assert condition message:
[ {{ condition }} ] || { echo -e 1>&2 "\n\x1b[1;41m Error \x1b[0m {{ message }}\n"; exit 1; }
assert condition message:
[ {{ condition }} ] || { echo -e 1>&2 "\n\x1b[1;41m Error \x1b[0m {{ message }}\n"; exit 1; }