rust/rust-update

32 lines
669 B
Plaintext
Raw Normal View History

2017-10-11 20:50:58 +02:00
#!/bin/sh
if [ "$1" = '-h' ] ; then
echo 'Updates rustc & clippy'
2018-06-07 18:47:11 +02:00
echo 'It first checks if clippy would compile at current nightly and if so, it updates.'
2017-10-11 20:50:58 +02:00
echo 'Options:'
echo '-h: This help message'
echo '-f: Skips the check and just updates'
exit
fi
set -ex
renice -n 10 -p $$
export CARGO_INCREMENTAL=0
export RUSTFLAGS='-C target-cpu=native'
try_out() {
export RUSTUP_HOME=$HOME/.rustup-attempt
test -d $RUSTUP_HOME || (rustup toolchain add nightly && rustup default nightly)
rustup update
cargo +nightly install --force clippy
unset RUSTUP_HOME
export RUSTUP_HOME
}
[ "$1" = '-f' ] || try_out
rustup update
cargo +nightly install --force clippy