update rustc compiler if the version does not satisfy minimal requirements of vergen-gix
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
ac829e2ff5
commit
47450a5c6e
14
update.sh
14
update.sh
@ -10,6 +10,20 @@ else
|
|||||||
echo "[+] nothing to update from the remote repository"
|
echo "[+] nothing to update from the remote repository"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
REQUIRED_VERSION="1.91.0"
|
||||||
|
CURRENT_VERSION=$(cargo --version | awk '{print $2}')
|
||||||
|
|
||||||
|
HIGHEST=$(printf '%s\n%s' "$CURRENT_VERSION" "$REQUIRED_VERSION" | sort -rV | head -n1)
|
||||||
|
if [ "$HIGHEST" == "$REQUIRED_VERSION" ]; then
|
||||||
|
echo "[!] Need to update rustc compiler because of the vergen-gix dependency"
|
||||||
|
echo "[!] For more info: https://github.com/rustyhorde/vergen#msrv"
|
||||||
|
rustup update
|
||||||
|
echo "[+] Setting latest rustc compiler version as a default one"
|
||||||
|
rustup default stable
|
||||||
|
echo "[+] Cleaning previous targets"
|
||||||
|
cargo clean
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[+] build for the new version starts in 3 seconds..."
|
echo "[+] build for the new version starts in 3 seconds..."
|
||||||
sleep 3
|
sleep 3
|
||||||
cargo build --release
|
cargo build --release
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user