Skip to content

Commit

Permalink
Detect rustfilt even when CARGO_BIN isn't in PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
defuse committed Jul 31, 2019
1 parent 7a888f5 commit f0693a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ fi
echo "building siderophile"
cargo build --release

if !(hash rustfilt) 2>/dev/null; then
# Where to look for `rustfilt`. If CARGO_HOME is set, use $CARGO_HOME/bin.
# Otherwise, use ~/.cargo/bin
CARGO_BIN=${CARGO_HOME:-~/.cargo}/bin

if !(PATH="$PATH:$CARGO_BIN" hash rustfilt) 2>/dev/null; then
echo "didn't find rustfilt, installing it now"
cargo install rustfilt
fi
Expand Down

0 comments on commit f0693a0

Please sign in to comment.