20-04-2026
This commit is contained in:
+22
-7
@@ -5,6 +5,7 @@ underline="\033[4m"
|
||||
ita_under="\033[3;4m"
|
||||
bgd="\033[1;4;31m"
|
||||
red="\033[1;31m"
|
||||
greenbold="\033[1;32m"
|
||||
bold="\033[1m"
|
||||
box="\033[1;41m"
|
||||
reset="\033[0m"
|
||||
@@ -21,16 +22,30 @@ fi
|
||||
if hash rustup 2>/dev/null; then
|
||||
|
||||
echo -e "🦀 ${underline}rustup check${reset}\n"
|
||||
rustup check
|
||||
#rustup check
|
||||
check=$(rustup check)
|
||||
#check=$(echo "$check" | sed 's/Up\ to\ date/${bold}Up\ to\ dateee${reset}/g')
|
||||
#echo ${check/Up to date/\{greenbold\}Up to dateee\{reset\}\}
|
||||
#Update available
|
||||
echo -e "$check"
|
||||
|
||||
|
||||
if [[ ! $(which rustup-init) =~ "homebrew" ]]; then
|
||||
echo -e "\n🦀 ${underline}Upgrading rustup itself !${reset}\n"
|
||||
rustup self update
|
||||
fi
|
||||
#if [[ ! $(which rustup-init) =~ "homebrew" ]]; then
|
||||
# echo -e "\n🦀 ${underline}Upgrading rustup itself !${reset}\n"
|
||||
# rustup self update
|
||||
#fi
|
||||
|
||||
echo -e "\n🦀 ${underline}Upgrading rust toolchains !${reset}\n"
|
||||
rustup update
|
||||
check_rust=$(echo "$check" | awk 'NR==1' | awk -F" - " '{print $2}')
|
||||
|
||||
if [[ $check_rust =~ "Update available" ]]; then
|
||||
echo "$check_rust"
|
||||
rustup update
|
||||
elif [[ $check_rust =~ "Up to date" ]]; then
|
||||
rust_version=$(echo "$check_rust" | awk -F" : " '{print $2}')
|
||||
echo -e "${greenbold}Rust is up to date!${reset}"" ($rust_version)"
|
||||
fi
|
||||
|
||||
# si erreur rustup update => rustup toolchain uninstall stable && rustup toolchain install stable
|
||||
|
||||
echo ""
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user