-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathstart.command
More file actions
executable file
·36 lines (28 loc) · 1004 Bytes
/
Copy pathstart.command
File metadata and controls
executable file
·36 lines (28 loc) · 1004 Bytes
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
#!/bin/zsh
set -u
SCRIPT_DIR="${0:A:h}"
cd "$SCRIPT_DIR" || exit 1
NODE_EXE="${MIX_STUDIO_NODE:-}"
if [[ -z "$NODE_EXE" ]]; then
NODE_EXE="$(command -v node 2>/dev/null || true)"
fi
if [[ -z "$NODE_EXE" || ! -x "$NODE_EXE" ]]; then
print -u2 "Node.js 22 or newer was not found. Install it from https://nodejs.org/ and run this file again."
exit 1
fi
NODE_MAJOR="$($NODE_EXE -p "process.versions.node.split('.')[0]" 2>/dev/null || true)"
if [[ ! "$NODE_MAJOR" =~ '^[0-9]+$' || "$NODE_MAJOR" -lt 22 ]]; then
print -u2 "Mix Studio requires Node.js 22 or newer. Install the current LTS from https://nodejs.org/."
exit 1
fi
if [[ ! -f install.json ]]; then
"$NODE_EXE" installer/bootstrap.js || exit $?
fi
export MIXBOX_RESTART_MODE=launcher
export PYTORCH_ENABLE_MPS_FALLBACK="${PYTORCH_ENABLE_MPS_FALLBACK:-1}"
(sleep 1; /usr/bin/open "http://127.0.0.1:${PORT:-3300}/" >/dev/null 2>&1) &
while true; do
"$NODE_EXE" server.js
STATUS=$?
[[ "$STATUS" -eq 75 ]] || exit "$STATUS"
done