-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.command
More file actions
executable file
·32 lines (30 loc) · 1.01 KB
/
Copy pathinstall.command
File metadata and controls
executable file
·32 lines (30 loc) · 1.01 KB
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
#!/bin/bash
# One-time setup: checks ffmpeg and installs the Python libraries.
cd "$(dirname "$0")" || exit 1
PY=""
# The setup writes down the Python it installed into. A double-clicked script
# and a terminal do not read the same profile, so “whichever python3 the shell
# offers” could be one interpreter here and another there — and everything
# installed by the setup was invisible to the program. What put the libraries
# on the disk is what opens the program.
MARK="app/.python-path"
if [ -r "$MARK" ]; then
SAVED="$(head -n 1 "$MARK")"
if [ -n "$SAVED" ] && "$SAVED" -c "" >/dev/null 2>&1; then PY="$SAVED"; fi
fi
if [ -z "$PY" ]; then
for c in python3 python; do
command -v "$c" >/dev/null 2>&1 && { PY="$c"; break; }
done
fi
if [ -z "$PY" ]; then
echo
echo " Python is not installed."
echo " Get it from https://python.org — or run: brew install python"
echo
read -r -p "Press Enter to close…" _
exit 1
fi
"$PY" app/tools/setup_check.py
echo
read -r -p "Press Enter to close…" _