-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstudio.command
More file actions
executable file
·31 lines (29 loc) · 1.02 KB
/
Copy pathstudio.command
File metadata and controls
executable file
·31 lines (29 loc) · 1.02 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
#!/bin/bash
# Karaoke Studio — the app window. macOS opens this file by double-click.
# Close this Terminal window to stop the program.
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
exec "$PY" app/studio.py "$@"