Skip to content

Commit

Permalink
Merge pull request #186 from tgross35/fix-syntax
Browse files Browse the repository at this point in the history
Fix `check_installed` to use `sh` rather than `bash` syntax
  • Loading branch information
tgross35 authored Nov 18, 2024
2 parents 11b8c43 + 4a04cbd commit 3dfb74c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,31 @@ no_just_parsing := '''
default:
just --list
_check_installed +dep:
# Verify that a tool is installed
_check-installed +dep:
#!/bin/sh
set -eau
check_installed() {
printf "checking $1... "
local dep=0
command -v "$1" 1>/dev/null || dep=$?
if [[ "${dep}" == 0 ]]; then
if command -v "$1"; then
echo "tool $1 found!"
else
echo
echo "tool $1 NOT found. This may be needed for some functionality"
fi
}
for d in {{dep}}; do
for d in {{ dep }}; do
check_installed $d
done
# Install needed packages and make sure tools are setup
setup *npm-args:
#!/bin/sh
set -eau
just _check_installed npm cargo clang clang-tidy clang-format kk
just _check-installed npm cargo clang clang-tidy clang-format
if which npm > /dev/null; then
npm install --include=dev {{ npm-args }}
Expand All @@ -97,7 +97,7 @@ _lint-min: _clone-repo-tree-sitter configure-compile-database
# Run the linter for JS, C, Cargo, and Python. Requires clang-tidy, clippy, and ruff.
lint: _lint-min
cargo clippy
@just _check_installed ruff
@just _check-installed ruff
ruff check .
_out-dirs:
Expand Down

0 comments on commit 3dfb74c

Please sign in to comment.