diff --git a/depends.txt b/depends.txt index e18d998..625f15a 100644 --- a/depends.txt +++ b/depends.txt @@ -2,4 +2,3 @@ cmake curl git pip -virtualenv diff --git a/device_specific/flash_the_m5stack_core_basic b/device_specific/flash_the_m5stack_core_basic index fee9a68..6ad0396 100755 --- a/device_specific/flash_the_m5stack_core_basic +++ b/device_specific/flash_the_m5stack_core_basic @@ -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" @@ -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}"/ diff --git a/device_specific/flash_the_m5stack_fire b/device_specific/flash_the_m5stack_fire index e5c94f8..55b2709 100755 --- a/device_specific/flash_the_m5stack_fire +++ b/device_specific/flash_the_m5stack_fire @@ -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" @@ -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}"/ diff --git a/device_specific/flash_the_m5stack_m5stickc_plus b/device_specific/flash_the_m5stack_m5stickc_plus index c884960..2899cb1 100755 --- a/device_specific/flash_the_m5stack_m5stickc_plus +++ b/device_specific/flash_the_m5stack_m5stickc_plus @@ -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" @@ -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}"/ diff --git a/device_specific/flash_the_ttgo_tdisplay b/device_specific/flash_the_ttgo_tdisplay index d9e4db1..dcc05f3 100755 --- a/device_specific/flash_the_ttgo_tdisplay +++ b/device_specific/flash_the_ttgo_tdisplay @@ -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" @@ -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}"/ diff --git a/flash_your_device b/flash_your_device index a07a849..e1364a1 100755 --- a/flash_your_device +++ b/flash_your_device @@ -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" @@ -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"