diff --git a/justfile b/justfile index ab1d746b2..e0f0d767f 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,8 @@ +alias a := all alias b := build alias c := clean alias co := cover -alias i := image +alias im := image alias l := lint alias r := run alias t := test @@ -40,6 +41,7 @@ _uid_args := if os_family() == "unix" { "" } +# Quick start default: #!/usr/bin/env bash set -eou pipefail @@ -49,6 +51,20 @@ default: just web just build +# Executes command against every justfile where avaiable. WARNING your mileage may very. +all +args='default': + #!/usr/bin/env bash + set -eou pipefail + {{ _with_debug }} + + # For each justfile, check if the first argument exists, and then execute it. + for f in `find . -name justfile`; do + arg=`echo {{ args }} | awk '{print $1;}'` + if just -f $f --show $arg &>/dev/null; then + just _with_docker just -f $f {{ args }} + fi + done + # Executes commands in ./test/bats/justfile. Equivalent to `just test/bats/`, but inside of Docker (i.e., just _with_docker just test/bats/). bats *args: #!/usr/bin/env bash @@ -97,6 +113,14 @@ executable-path: just _with_docker echo '$(./scripts/get-executable-path.bash {{ _cmd }} $(just version) $(go env GOHOSTOS) $(go env GOHOSTARCH))' +# Fixes linting errors +fix: + #!/usr/bin/env bash + set -eou pipefail + {{ _with_debug }} + + ./scripts/ccheck.py ./scripts/ccheck.config --fix + # Build the image. Typically does not need to be done very often. image: #!/usr/bin/env bash diff --git a/test/bats/justfile b/test/bats/justfile index 249f3163d..75b706375 100644 --- a/test/bats/justfile +++ b/test/bats/justfile @@ -1,3 +1,7 @@ +alias c := clean +alias i := install +alias t := test + _with_debug := if env_var_or_default("DEBUG", "true") == "true" { "set -x pipefail" } else { diff --git a/test/cy/justfile b/test/cy/justfile index 67198f146..bcef43c14 100644 --- a/test/cy/justfile +++ b/test/cy/justfile @@ -1,3 +1,7 @@ +alias c := clean +alias i := install +alias t := test + _with_debug := if env_var_or_default("DEBUG", "true") == "true" { "set -x pipefail" } else {