forked from tiny-pilot/tinypilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-from-source
executable file
·48 lines (35 loc) · 1.5 KB
/
install-from-source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Installs the local directory's version of TinyPilot's code onto the current
# system.
#
# This script is only for development. TinyPilot Community users should use the
# get-tinypilot.sh script in the directory root. TinyPilot Pro users should use
# get-tinypilot-pro.sh from the licensed URL.
# Exit on first failure.
set -e
# Echo commands before executing them, by default to stderr.
set -x
# Exit on unset variable.
set -u
# Change directory to repository root.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
readonly SCRIPT_DIR
cd "${SCRIPT_DIR}/.."
./dev-scripts/build-debian-pkg "linux/arm/v7"
# Shellcheck recommends find instead of ls for non-alphanumeric filenames, but
# we don't expect non-alphanumeric filenames, and the find equivalent is more
# complex.
# shellcheck disable=SC2012
LATEST_DEBIAN_PACKAGE="${PWD}/$(ls -t debian-pkg/releases/tinypilot*.deb | head -n 1)"
readonly LATEST_DEBIAN_PACKAGE
# Clear any previous TinyPilot Debian packages in the bundle directory.
find ./bundler/bundle/ -name 'tinypilot*.deb' -delete
mv "${LATEST_DEBIAN_PACKAGE}" ./bundler/bundle/
./bundler/create-bundle
# Shellcheck recommends find instead of ls for non-alphanumeric filenames, but
# we don't expect non-alphanumeric filenames, and the find equivalent is more
# complex.
# shellcheck disable=SC2012
LATEST_INSTALL_BUNDLE="${PWD}/$(ls -t bundler/dist/tinypilot*.tgz | head -n 1)"
readonly LATEST_INSTALL_BUNDLE
sudo ./dev-scripts/install-bundle "${LATEST_INSTALL_BUNDLE}"