Skip to content

Instantly share code, notes, and snippets.

@antonpegov
Created January 17, 2022 07:45
Show Gist options
  • Save antonpegov/364a0968b02a0cac24bd3152865a0f06 to your computer and use it in GitHub Desktop.
Save antonpegov/364a0968b02a0cac24bd3152865a0f06 to your computer and use it in GitHub Desktop.
Find actual rust build
#!/bin/bash
for i in `seq 0 99`; do
echo " === === === "
RUST_DATE=`date -u -d "-$i days" "+%Y-%m-%d"`
echo "Checking $RUST_DATE..."
TOML=`curl -sf https://static.rust-lang.org/dist/$RUST_DATE/channel-rust-nightly.toml`
if [[ $? -gt 0 ]]; then
echo "Rust $RUST_DATE does not exist"
else
if [[ -n `echo $TOML | grep rls` && -n `echo $TOML | grep fmt` ]]; then
echo "Rust $RUST_DATE has both rls and rustfmt"
echo "Run \"rustup default nightly-$RUST_DATE\" to install it"
break
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment