Add run file with a build task

This commit is contained in:
Oliver Davies 2024-01-25 00:11:51 +00:00
parent fe9435df8a
commit 2caa74232a
2 changed files with 20 additions and 0 deletions

View file

@ -13,6 +13,7 @@
rm $out/.envrc rm $out/.envrc
rm $out/flake.lock rm $out/flake.lock
rm $out/flake.nix rm $out/flake.nix
rm $out/run
rm $out/stylua.toml rm $out/stylua.toml
''; '';
src = ./.; src = ./.;

19
run Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -o nounset
set -o pipefail
function build {
nix build --json --no-link --print-build-logs ".#${1:-default}"
}
function help {
printf "%s <task> [args]\n\nTasks:\n" "${0}"
compgen -A function | grep -v "^_" | cat -n
printf "\nExtended help:\n Each task has comments for general usage\n"
}
TIMEFORMAT="Task completed in %3lR"
time "${@:-help}"