Add run
file with a build
task
This commit is contained in:
parent
fe9435df8a
commit
2caa74232a
|
@ -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
19
run
Executable 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}"
|
Reference in a new issue