Skip to content

Instantly share code, notes, and snippets.

@richo
Created April 5, 2015 20:25
Show Gist options
  • Select an option

  • Save richo/0f8f65a69b130bf2da4a to your computer and use it in GitHub Desktop.

Select an option

Save richo/0f8f65a69b130bf2da4a to your computer and use it in GitHub Desktop.
#!/bin/sh
set -xe
rust_version=$(head -n 1 RELEASES.md | cut -f 2 -d " ")
major=$(echo "$rust_version" | cut -f 1 -d '.')
minor=$(echo "$rust_version" | cut -f 2 -d '.')
patch=$(echo "$rust_version" | cut -f 3 -d '.')
rust_version="${major}.$minor.${patch}"
rev=`git rev-parse --short @`
branch=$(git symbolic-ref HEAD | sed -e 's|refs/heads/||' -e 's|/|_|g')
if [ "$branch" != "master" ]; then
prefix="~/.rusts/$rust_version-$branch"
else
prefix="~/.rusts/$rust_version-$rev"
fi
./configure --prefix=$prefix
make -j4
make install
set +x
echo "You may want to update your dotfiles to use '$(basename ${prefix})'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment