Make indentation consistent in bash scripts

This commit is contained in:
Matthew D. Scholefield 2018-04-20 12:09:53 -05:00
parent ffcf4a0e9d
commit ef96763327
2 changed files with 15 additions and 15 deletions

View File

@ -14,8 +14,8 @@
# limitations under the License. # limitations under the License.
if ! [[ "$1" =~ .*\.net$ ]] || ! [ -d "$2" ]; then if ! [[ "$1" =~ .*\.net$ ]] || ! [ -d "$2" ]; then
echo "Usage: $0 <model>.net <folder_name>" echo "Usage: $0 <model>.net <folder_name>"
exit 1 exit 1
fi fi
[ -d .cache/precise-data ] || git clone https://github.com/mycroftai/precise-data .cache/precise-data [ -d .cache/precise-data ] || git clone https://github.com/mycroftai/precise-data .cache/precise-data

View File

@ -16,25 +16,25 @@
is_command() { hash "$1" 2>/dev/null; } is_command() { hash "$1" 2>/dev/null; }
apt_is_locked() { fuser /var/lib/dpkg/lock >/dev/null 2>&1; } apt_is_locked() { fuser /var/lib/dpkg/lock >/dev/null 2>&1; }
wait_for_apt() { wait_for_apt() {
if apt_is_locked; then if apt_is_locked; then
echo "Waiting to obtain dpkg lock file..." echo "Waiting to obtain dpkg lock file..."
while apt_is_locked; do echo .; sleep 0.5; done while apt_is_locked; do echo .; sleep 0.5; done
fi fi
} }
vpython() { "$VENV/bin/python" $@; } vpython() { "$VENV/bin/python" $@; }
vpip() { "$VENV/bin/pip" $@; } vpip() { "$VENV/bin/pip" $@; }
install_tensorflow_armv7l() { install_tensorflow_armv7l() {
maj_min=$(python3 -c "import sys; i = sys.version_info; print(str(i[0]) + str(i[1]))") maj_min=$(python3 -c "import sys; i = sys.version_info; print(str(i[0]) + str(i[1]))")
whl=tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl whl=tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl
ver_whl=${whl//34/$maj_min} ver_whl=${whl//34/$maj_min}
url=https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.1.0/$whl url=https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.1.0/$whl
wget "$url" -O $ver_whl wget "$url" -O $ver_whl
vpip install "$ver_whl" vpip install "$ver_whl"
vpip uninstall mock || true; vpip install mock vpip uninstall mock || true; vpip install mock
rm "$ver_whl" rm "$ver_whl"
} }
############################################# #############################################
@ -49,14 +49,14 @@ if is_command apt-get; then
fi fi
if [ ! -x "$VENV/bin/pip" ]; then if [ ! -x "$VENV/bin/pip" ]; then
python3 -m venv "$VENV" --without-pip python3 -m venv "$VENV" --without-pip
curl https://bootstrap.pypa.io/get-pip.py | vpython curl https://bootstrap.pypa.io/get-pip.py | vpython
fi fi
arch="$(python3 -c 'import platform; print(platform.machine())')" arch="$(python3 -c 'import platform; print(platform.machine())')"
if [ "$arch" = "armv7l" ] && ! vpython -c 'import tensorflow' 2>/dev/null; then if [ "$arch" = "armv7l" ] && ! vpython -c 'import tensorflow' 2>/dev/null; then
install_tensorflow_armv7l install_tensorflow_armv7l
fi fi
vpip install -e runner/ vpip install -e runner/