summaryrefslogtreecommitdiff
path: root/Justfile
diff options
context:
space:
mode:
authorJames Reilly <jreilly1821@gmail.com>2025-05-14 22:13:36 +0530
committerGitHub <noreply@github.com>2025-05-14 12:43:36 -0400
commit84bf48b851bef473f1a0fcaf2daa8d8a45487f14 (patch)
tree315a79e56cf6feddc1d1511ea2c3e0989f7a9e47 /Justfile
parent2dcbaa2b4ab383ac3a45e5efe080849e5ffd8b5e (diff)
downloadAeroCore-OS-84bf48b851bef473f1a0fcaf2daa8d8a45487f14.tar.gz
AeroCore-OS-84bf48b851bef473f1a0fcaf2daa8d8a45487f14.zip
fix(justfile): `just lint` and `just format` pass when `shellcheck` and `shfmt` do not exist (#105)
Diffstat (limited to 'Justfile')
-rw-r--r--Justfile16
1 files changed, 16 insertions, 0 deletions
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 "{}" ';'