Skip to content

Commit

Permalink
fix: venv dependency check on debian (#14)
Browse files Browse the repository at this point in the history
* fix: venv dependency check on debian

* fix shfmt

* fix: add venv dependency check to all scripts
  • Loading branch information
1-21gigasats authored May 3, 2024
1 parent 86f6ee7 commit a8b23ce
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
1 change: 0 additions & 1 deletion depends.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ cmake
curl
git
pip
virtualenv
10 changes: 9 additions & 1 deletion device_specific/flash_the_m5stack_core_basic
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..."
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
if [ "${dependency}" == "pip" ]; 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"
Expand All @@ -61,6 +61,14 @@ while read -r dependency; do
fi
done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt)

if grep -qEi '(debian|ubuntu)' /etc/os-release; then
if ! dpkg -s python3-venv &> /dev/null; then
echo -en "Package python3-venv is missing, please install by running:\n\n"
echo -en "sudo apt update && sudo apt install -y python3-venv\n\n"
exit 1
fi
fi

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}"
cd "${esp_idf_temp_directory}"/
Expand Down
10 changes: 9 additions & 1 deletion device_specific/flash_the_m5stack_fire
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..."
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
if [ "${dependency}" == "pip" ]; 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"
Expand All @@ -61,6 +61,14 @@ while read -r dependency; do
fi
done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt)

if grep -qEi '(debian|ubuntu)' /etc/os-release; then
if ! dpkg -s python3-venv &> /dev/null; then
echo -en "Package python3-venv is missing, please install by running:\n\n"
echo -en "sudo apt update && sudo apt install -y python3-venv\n\n"
exit 1
fi
fi

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}"
cd "${esp_idf_temp_directory}"/
Expand Down
10 changes: 9 additions & 1 deletion device_specific/flash_the_m5stack_m5stickc_plus
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..."
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
if [ "${dependency}" == "pip" ]; 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"
Expand All @@ -61,6 +61,14 @@ while read -r dependency; do
fi
done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt)

if grep -qEi '(debian|ubuntu)' /etc/os-release; then
if ! dpkg -s python3-venv &> /dev/null; then
echo -en "Package python3-venv is missing, please install by running:\n\n"
echo -en "sudo apt update && sudo apt install -y python3-venv\n\n"
exit 1
fi
fi

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}"
cd "${esp_idf_temp_directory}"/
Expand Down
10 changes: 9 additions & 1 deletion device_specific/flash_the_ttgo_tdisplay
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..."
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
if [ "${dependency}" == "pip" ]; 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"
Expand All @@ -61,6 +61,14 @@ while read -r dependency; do
fi
done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt)

if grep -qEi '(debian|ubuntu)' /etc/os-release; then
if ! dpkg -s python3-venv &> /dev/null; then
echo -en "Package python3-venv is missing, please install by running:\n\n"
echo -en "sudo apt update && sudo apt install -y python3-venv\n\n"
exit 1
fi
fi

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}"
cd "${esp_idf_temp_directory}"/
Expand Down
11 changes: 10 additions & 1 deletion flash_your_device
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Linux*)
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
if [ "${dependency}" == "pip" ]; 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"
Expand All @@ -62,6 +62,15 @@ Linux*)
fi
done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt)
echo "ok."

if grep -qEi '(debian|ubuntu)' /etc/os-release; then
if ! dpkg -s python3-venv &> /dev/null; then
echo -en "Package python3-venv is missing, please install by running:\n\n"
echo -en "sudo apt update && sudo apt install -y python3-venv\n\n"
exit 1
fi
fi

;;
Darwin*)
machine="macOS"
Expand Down

0 comments on commit a8b23ce

Please sign in to comment.