Skip to content

Commit

Permalink
feat: install dependencies from text file
Browse files Browse the repository at this point in the history
  • Loading branch information
epiccurious committed Dec 17, 2023
1 parent e7e18eb commit ec62c61
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions flash_your_device
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,18 @@ Linux*)
machine="Linux"
echo "Detected ${machine}."
echo -n "Checking for dependencies... "
if ! command -v cmake &> /dev/null; then
echo -e "\n\nERROR:\ncmake was not found on your system.\nPlease install cmake by running:\n\nsudo apt update && sudo apt install -y cmake\n"
exit 1
elif ! command -v git &> /dev/null; then
echo -e "\n\nERROR:\ngit was not found on your system.\nPlease install git by running:\n\nsudo apt update && sudo apt install -y git\n"
exit 1
elif ! command -v pip &> /dev/null; then
echo -e "\n\nERROR:\npip was not found on your system.\nPlease install pip by running:\n\nsudo apt update && sudo apt install -y python3-pip\n"
exit 1
elif ! command -v virtualenv &> /dev/null; then
echo -e "\n\nERROR:\nvirtualenv was not found on your system.\nPlease install virtualenv by running:\n\nsudo apt update && sudo apt install -y python3-virtualenv\n"
exit 1
fi

while read -r dependency; do
if ! command -v "${dependency}" &> /dev/null; then
echo -en "\n\nERROR:\n${dependency} was not found on your system.\nPlease install ${dependency} by running:\n\n"
if [ "${dependency}" == "pip" ] || [ "${dependency}" == "virtualenv" ]; then
echo -en "sudo apt update && sudo apt install -y python3-${dependency}\n\n"
else
echo -en "sudo apt update && sudo apt install -y ${dependency}\n\n"
fi
exit 1
fi
done < <(curl -fsSL https://github.com/epiccurious/jade-diy/raw/master/depends.txt)
echo "ok."
;;
Darwin*)
Expand Down

0 comments on commit ec62c61

Please sign in to comment.