0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-19 19:42:19 +02:00
libsignal/java/find_cargo.sh
Jordan Rose 4470192aa6 java: When running Cargo as part of Gradle, fall back to ~/.cargo/bin
This is important when the Gradle configuration is processed by an IDE
on macOS, which won't have had PATH set by shell login scripts.
2024-08-22 09:23:16 -07:00

18 lines
398 B
Bash

#!/bin/bash
#
# Copyright (C) 2024 Signal Messenger, LLC.
# SPDX-License-Identifier: AGPL-3.0-only
#
# This script exists entirely for running inside an environment where `cargo` may not be in PATH
# (*cough* IDEs on Macs *cough*). It falls back to the default rustup install location.
CARGO=cargo
if ! command -v "$CARGO" > /dev/null; then
CARGO="$HOME/.cargo/bin/cargo"
fi
"$CARGO" "$@"