From b7490fe2c9612f17fa8fc989b947707eee24ba38 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Wed, 14 May 2025 22:13:36 +0530 Subject: fix(justfile): `just lint` and `just format` pass when `shellcheck` and `shfmt` do not exist (#105) --- Justfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Justfile b/Justfile index f9c481c..0078339 100644 --- a/Justfile +++ b/Justfile @@ -325,8 +325,24 @@ spawn-vm rebuild="0" type="qcow2" ram="6G": # Runs shell check on all Bash scripts lint: + #!/usr/bin/env bash + set -eoux pipefail + # Check if shellcheck is installed + if ! command -v shellcheck &> /dev/null; then + echo "shellcheck could not be found. Please install it." + exit 1 + fi + # Run shellcheck on all Bash scripts /usr/bin/find . -iname "*.sh" -type f -exec shellcheck "{}" ';' # Runs shfmt on all Bash scripts format: + #!/usr/bin/env bash + set -eoux pipefail + # Check if shfmt is installed + if ! command -v shfmt &> /dev/null; then + echo "shellcheck could not be found. Please install it." + exit 1 + fi + # Run shfmt on all Bash scripts /usr/bin/find . -iname "*.sh" -type f -exec shfmt --write "{}" ';' -- cgit v1.2.3