From f31717bca97f9b0f5b0d17b3f224b77c9bb8b809 Mon Sep 17 00:00:00 2001 From: "Matthew D. Scholefield" Date: Wed, 8 Nov 2017 21:37:29 -0600 Subject: [PATCH] Check for apt-get before doing Ubuntu-specific things --- setup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 6b6ad84..5cd1ce7 100755 --- a/setup.sh +++ b/setup.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +found_exe() { + hash "$1" 2>/dev/null +} + apt_is_locked() { fuser /var/lib/dpkg/lock >/dev/null 2>&1 } @@ -13,8 +17,10 @@ wait_for_apt() { set -e -wait_for_apt -sudo apt-get install -y python3-pip libblas-dev python3-scipy cython python3-h5py portaudio19-dev +if found_exe apt-get; then + wait_for_apt + sudo apt-get install -y python3-pip libblas-dev python3-scipy cython python3-h5py portaudio19-dev +fi arch="$(python3 -c 'import platform; print(platform.machine())')"