Files
stambha/dev/cargo
T

15 lines
426 B
Bash
Executable File

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
if [ -x "$root/.tools/rust/cargo/bin/cargo" ]; then
export CARGO_HOME="$root/.tools/rust/cargo"
export RUSTUP_HOME="$root/.tools/rust/rustup"
export PATH="$CARGO_HOME/bin:$PATH"
cargo_bin="$CARGO_HOME/bin/cargo"
else
cargo_bin=cargo
fi
if [ "$(uname -s)" = Darwin ]; then export CC=/usr/bin/clang; fi
cd "$root"
exec "$cargo_bin" "$@"