Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: install dependencies from text file #61

Merged
merged 3 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions device_specific/flash_the_m5stack_core_basic
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,17 @@ fi

echo "LINUX ONLY. Flashing the ${chosen_device}..."

if ! command -v cmake &> /dev/null; then
echo -e "\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 "\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\RROR:\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 "\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)

if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then
git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}"
Expand Down
24 changes: 11 additions & 13 deletions device_specific/flash_the_m5stack_fire
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,17 @@ fi

echo "LINUX ONLY. Flashing the ${chosen_device}..."

if ! command -v cmake &> /dev/null; then
echo -e "\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 "\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\RROR:\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 "\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)

if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then
git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}"
Expand Down
24 changes: 11 additions & 13 deletions device_specific/flash_the_m5stack_m5stickc_plus
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,17 @@ fi

echo "LINUX ONLY. Flashing the ${chosen_device}..."

if ! command -v cmake &> /dev/null; then
echo -e "\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 "\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\RROR:\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 "\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)

if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then
git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}"
Expand Down
24 changes: 11 additions & 13 deletions device_specific/flash_the_ttgo_tdisplay
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,17 @@ fi

echo "LINUX ONLY. Flashing the ${chosen_device}..."

if ! command -v cmake &> /dev/null; then
echo -e "\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 "\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\RROR:\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 "\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)

if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then
git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}"
Expand Down
24 changes: 11 additions & 13 deletions flash_your_device
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,17 @@ 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