File: rustup.sh

package info (click to toggle)
rustc 1.63.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 445,532 kB
  • sloc: xml: 147,972; javascript: 9,201; sh: 8,612; python: 6,901; ansic: 5,674; cpp: 4,961; makefile: 3,611; asm: 1,438; ruby: 68
file content (29 lines) | stat: -rwxr-xr-x 790 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash

set -e

case $1 in
    "prepare")
        TOOLCHAIN=$(date +%Y-%m-%d)

        echo "=> Installing new nightly"
        rustup toolchain install --profile minimal nightly-${TOOLCHAIN} # Sanity check to see if the nightly exists
        echo nightly-${TOOLCHAIN} > rust-toolchain

        echo "=> Uninstalling all old nightlies"
        for nightly in $(rustup toolchain list | grep nightly | grep -v $TOOLCHAIN | grep -v nightly-x86_64); do
            rustup toolchain uninstall $nightly
        done

        ./clean_all.sh
        ./prepare.sh
        ;;
    "commit")
        git add rust-toolchain
        git commit -m "Rustup to $(rustc -V)"
        ;;
    *)
        echo "Unknown command '$1'"
        echo "Usage: ./rustup.sh prepare|commit"
        ;;
esac