Skip to content

Instantly share code, notes, and snippets.

@saml
Created August 20, 2015 20:23
Show Gist options
  • Select an option

  • Save saml/57a82feecd031369e3ba to your computer and use it in GitHub Desktop.

Select an option

Save saml/57a82feecd031369e3ba to your computer and use it in GitHub Desktop.
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 prefix"
exit 1
fi
p="$1"
cd /tmp
rm -f rustup.sh
wget https://static.rust-lang.org/rustup.sh
sh rustup.sh --prefix="$p" --uninstall
sh rustup.sh --prefix="$p" --disable-sudo --save
v="$(rustc --version|cut -d' ' -f2)"
n="rustc-$v"
f="$n-src.tar.gz"
wget "https://static.rust-lang.org/dist/$f"
tar xvzf "$f"
mv "$n/src" "$p"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment