mirror of
https://github.com/system76/firmware-open.git
synced 2025-07-04 05:13:23 +00:00
scripts: Update rustup or inform user of env vars
Ensure rustup is up-to-date to avoid users having a version that is too old to support the TOML format. If rustup was just installed, tell the user to source the new env vars to use the correct version of the toolchain. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
parent
10c256d6fa
commit
cf7fc2c540
1 changed files with 11 additions and 1 deletions
|
@ -114,7 +114,12 @@ curl -sSf https://review.coreboot.org/tools/hooks/commit-msg \
|
||||||
-o .git/modules/coreboot/hooks/commit-msg && \
|
-o .git/modules/coreboot/hooks/commit-msg && \
|
||||||
chmod +x .git/modules/coreboot/hooks/commit-msg
|
chmod +x .git/modules/coreboot/hooks/commit-msg
|
||||||
|
|
||||||
if ! which rustup &> /dev/null; then
|
RUSTUP_NEW_INSTALL=0
|
||||||
|
if which rustup &> /dev/null; then
|
||||||
|
msg "Updating rustup"
|
||||||
|
rustup self update
|
||||||
|
else
|
||||||
|
RUSTUP_NEW_INSTALL=1
|
||||||
msg "Installing Rust"
|
msg "Installing Rust"
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
||||||
| sh -s -- -y --default-toolchain none
|
| sh -s -- -y --default-toolchain none
|
||||||
|
@ -126,5 +131,10 @@ fi
|
||||||
msg "Installing pinned Rust toolchain and components"
|
msg "Installing pinned Rust toolchain and components"
|
||||||
rustup show
|
rustup show
|
||||||
|
|
||||||
|
if [[ $RUSTUP_NEW_INSTALL = 1 ]]; then
|
||||||
|
msg "\x1B[33m>> rustup was just installed. Ensure cargo is on the PATH with:"
|
||||||
|
echo -e " source ~/.cargo/env\n"
|
||||||
|
fi
|
||||||
|
|
||||||
msg "\x1B[32mSuccessfully installed dependencies"
|
msg "\x1B[32mSuccessfully installed dependencies"
|
||||||
echo "Ready to run ./scripts/build.sh [model]" >&2
|
echo "Ready to run ./scripts/build.sh [model]" >&2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue