mirror of
https://github.com/rustls/rustls.git
synced 2026-10-29 02:07:14 +08:00
25 lines
554 B
Bash
Executable File
25 lines
554 B
Bash
Executable File
#!/bin/sh
|
|
set -xe
|
|
|
|
ADMIN=$(dirname "$0")
|
|
PREV=$(pwd)
|
|
if [ ! -d $ADMIN/rustfmt ] ; then
|
|
COMMIT=8829e455b722f1ba8ade915ad2687639a2abb2c3
|
|
cd $ADMIN
|
|
git init rustfmt
|
|
cd rustfmt
|
|
git fetch --depth=1 https://github.com/rust-lang/rustfmt $COMMIT
|
|
git checkout $COMMIT
|
|
cd ../..
|
|
fi
|
|
|
|
if [ ! -x $ADMIN/rustfmt/target/release/cargo-fmt ] ; then
|
|
cd $ADMIN/rustfmt
|
|
export CFG_RELEASE=nightly
|
|
export CFG_RELEASE_CHANNEL=nightly
|
|
cargo build --release --features rustfmt,cargo-fmt
|
|
fi
|
|
|
|
cd $PREV
|
|
PATH=$ADMIN/rustfmt/target/release/:$PATH cargo-fmt "$@"
|