Skip to content

Commit

Permalink
fix issues when creating directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Torrekie committed Aug 12, 2021
1 parent 61649b6 commit c59ddf7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,48 +180,48 @@ if [ ${FILE_ARCH} == "iphoneos-arm" ]; then
fi
fi

mkdir -p fastbuilder-temp ${HOME}/./fastbuilder
mkdir -p ${PREFIX}/./fastbuilder-temp ${PREFIX}/./fastbuilder
if [[ ${SYSTEM_NAME} == "Linux" ]] && [[ $(uname -o) != "Android" ]]; then
# We have not provide Linux distribution packages currently, so binaries only
printf "Downloading FastBuilder binary..."
${DL_TOOL} -o fastbuilder-temp/fastbuilder ${FB_LINK}
${DL_TOOL} -o ${PREFIX}/./fastbuilder-temp/fastbuilder ${FB_LINK}
if [ $? -eq 0 ]; then
printf "\033[32mSuccessfully downloaded FastBuilder (x86_64)\033[0m\n"
else
printf "\033[31mDownload failure! Please check your connections.\nStopping.\033[0m\n"
quit_installer 1
fi
if [ ${ROOT_REQUIRED} == "1" ]; then
${INSTALL} fastbuilder-temp/fastbuilder ${BINDIR}
${INSTALL} ${PREFIX}/./fastbuilder-temp/fastbuilder ${BINDIR}
else
${INSTALL} fastbuilder-temp/fastbuilder ${PREFIX}/
${INSTALL} ${PREFIX}/./fastbuilder-temp/fastbuilder ${PREFIX}/
fi
elif [[ ${SYSTEM_NAME} == "Darwin" ]] && [[ ${FILE_ARCH} != "iphoneos-arm" ]]; then
printf "Downloading FastBuilder binary..."
${DL_TOOL} -o fastbuilder-temp/fastbuilder ${FB_LINK}-macos
${DL_TOOL} -o ${PREFIX}/./fastbuilder-temp/fastbuilder ${FB_LINK}-macos
if [ $? -eq 0 ]; then
printf "\033[32mSuccessfully downloaded FastBuilder (Universal)\033[0m\n"
else
printf "\033[31mDownload failure! Please check your connections.\nStopping.\033[0m\n"
quit_installer 1
fi
if [ ${ROOT_REQUIRED} == "1" ]; then
${INSTALL} fastbuilder-temp/fastbuilder ${BINDIR}
${INSTALL} ${PREFIX}/./fastbuilder-temp/fastbuilder ${BINDIR}
else
${INSTALL} fastbuilder-temp/fastbuilder ${PREFIX}/
${INSTALL} ${PREFIX}/./fastbuilder-temp/fastbuilder ${PREFIX}/
fi
else
# Download a file contains the latest version num for FastBuilder distros
printf "Getting latest version of FastBuilder..."
${DL_TOOL} -o fastbuilder-temp/version ${FB_DOMAIN}${FB_LOCATION_ROOT}version
${DL_TOOL} -o ${PREFIX}/./fastbuilder-temp/version ${FB_DOMAIN}${FB_LOCATION_ROOT}version
if [ $? -eq 0 ]; then
FB_VER=$(cat fastbuilder-temp/version | sed -n -e 'H;${x;s/\n//g;p;}')
else
printf "\033[31mDownload failure! Please check your connections.\nStopping.\033[0m\n"
quit_installer 1
fi
printf "Downloading FastBuilder package...\n"
${DL_TOOL} -o fastbuilder-temp/fastbuilder.deb ${FB_LINK}_${FB_VER}_${FILE_ARCH}${FILE_TYPE}
${DL_TOOL} -o ${PREFIX}/./fastbuilder-temp/fastbuilder.deb ${FB_LINK}_${FB_VER}_${FILE_ARCH}${FILE_TYPE}
if [ $? -eq 0 ]; then
printf "\033[32mSuccessfully downloaded FastBuilder\033[0m\n"
else
Expand All @@ -232,15 +232,15 @@ else
# If not, it will unpack it and export the FastBuilder executable to PATH
if [ ${ROOT_REQUIRED} == "1" ]; then
printf "Installing deb package...\n"
dpkg -i fastbuilder-temp/fastbuilder.deb
dpkg -i ${PREFIX}/./fastbuilder-temp/fastbuilder.deb
if [ $? != "0" ]; then
printf "\033[31mSome errors occured when calling Debian Packager.\nYou may want to run \"dpkg --configure -a\" to fix some problems.\033[0m\n"
quit_installer 1
fi
else
printf "Installing FastBuilder to specified path: ${PREFIX}\n"
mkdir -p ${PREFIX}
dpkg -x fastbuilder-temp/fastbuilder.deb fastbuilder/
dpkg -x ${PREFIX}/./fastbuilder-temp/fastbuilder.deb ${PREFIX}/./fastbuilder/
if [ $(uname -o | grep "Android" | echo $?) -eq 0 ]; then
mv ${PREFIX}/data/data/com.termux/files/usr/bin/fastbuilder ${PREFIX}/
# Remember to add a dot in front of the target directory
Expand Down

0 comments on commit c59ddf7

Please sign in to comment.