Skip to content

Commit

Permalink
Adds 'just all' and 'just fix'.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein committed Oct 13, 2023
1 parent 86b0f30 commit 7d8cbe3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
alias a := all
alias b := build
alias c := clean
alias co := cover
Expand Down Expand Up @@ -40,6 +41,7 @@ _uid_args := if os_family() == "unix" {
""
}

# Quick start
default:
#!/usr/bin/env bash
set -eou pipefail
Expand All @@ -49,6 +51,29 @@ default:
just web
just build

# Executes commands where avaiable. WARNING your mileage may very.
all *args:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
if $(cd web/ && just --show {{ args }} &>/dev/null); then
just web {{ args }}
fi

if $(just --show {{ args }} &>/dev/null); then
just {{ args }}
fi

if $(cd test/bats && just --show {{ args }} &>/dev/null); then
just bats {{ args }}
fi

if $(cd test/cy && just --show {{ args }} &>/dev/null); then
just cy {{ args }}
fi


# 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
Expand Down Expand Up @@ -97,6 +122,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
Expand Down

0 comments on commit 7d8cbe3

Please sign in to comment.