From 9a0f77770dcd5df0396d51bc19884b06fcd73e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80?= <148970641+Egor00f@users.noreply.github.com> Date: Sun, 16 Mar 2025 09:07:42 +0000 Subject: [PATCH] fix install.sh --- install.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 797e683..ea68137 100755 --- a/install.sh +++ b/install.sh @@ -35,14 +35,23 @@ check_utils(){ fi } -TOOLCHAIN_DIR=$(head -n 1 $INSTALL_PATH_FILE) -echo -n -e "\e[0mToolchain install path \e[90m(default is $TOOLCHAIN_DIR)\e[97m: " -read INPUT - -if [[ ! -z "$INPUT" ]]; then - TOOLCHAIN_DIR=$INPUT +if [ -f $INSTALL_PATH_FILE ]; then + TOOLCHAIN_DIR=$(head -n 1 $INSTALL_PATH_FILE) +else + echo -n -e "\e[0mToolchain install path \e[90m(default is $DEFAULT_TOOLCHAIN_DIR)\e[97m: " + read INPUT + if [[ ! -z "$INPUT" ]]; then + TOOLCHAIN_DIR=$INPUT + if [[ ! -z "$INPUT" ]]; then + TOOLCHAIN_DIR=$INPUe + else + TOOLCHAIN_DIR=$DEFAULT_TOOLCHAIN_DIR + fi + fi fi +echo -e "\e[0mInstalling toolchain to \e[97m$TOOLCHAIN_DIR\e[0m" + print_msg "Checking utilities..."