justfile improvement and deps

This commit is contained in:
Yuri Astrakhan 2024-02-05 21:49:36 -05:00
parent 35d8e25703
commit b4dd29d5ba
2 changed files with 12 additions and 5 deletions

4
Cargo.lock generated
View File

@ -1634,9 +1634,9 @@ dependencies = [
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3"
[[package]] [[package]]
name = "hex" name = "hex"

View File

@ -344,7 +344,14 @@ install-sqlx: (cargo-install "cargo-sqlx" "sqlx-cli" "--no-default-features" "--
# Check if a certain Cargo command is installed, and install it if needed # Check if a certain Cargo command is installed, and install it if needed
[private] [private]
cargo-install $COMMAND $INSTALL_CMD="" *ARGS="": cargo-install $COMMAND $INSTALL_CMD="" *ARGS="":
@if ! command -v $COMMAND &> /dev/null; then \ #!/usr/bin/env sh
echo "$COMMAND could not be found. Installing it with cargo install ${INSTALL_CMD:-$COMMAND} {{ ARGS }}" ;\ set -eu
cargo install ${INSTALL_CMD:-$COMMAND} {{ ARGS }} ;\ if [ ! command -v $COMMAND &> /dev/null ]; then
if [ ! command -v cargo-binstall &> /dev/null ]; then
echo "$COMMAND could not be found. Installing it with cargo install ${INSTALL_CMD:-$COMMAND} {{ ARGS }}"
cargo install ${INSTALL_CMD:-$COMMAND} {{ ARGS }}
else
echo "$COMMAND could not be found. Installing it with cargo binstall ${INSTALL_CMD:-$COMMAND} {{ ARGS }}"
cargo binstall ${INSTALL_CMD:-$COMMAND} {{ ARGS }}
fi
fi fi