Files
obs-studio/CI/steam/scripts_macos/launch.sh
derrod d6f0270f49 CI: Fix Steam launching x86 version under Rosetta
Apparently Steam running the OBS launch script makes it run
inside Rosetta as well, so it ended up launching the x86 version
even on arm64 systems.

Explicitly detect Rosetta translation and set arm64 in those cases.
2022-10-19 12:35:44 -07:00

28 lines
641 B
Bash

#!/bin/zsh
arch_name="$(uname -m)"
# When the script is launched from Steam, it'll be run through Rosetta.
# Manually override arch to arm64 in that case.
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
arch_name="arm64"
fi
# Allow users to force Rosetta
if [[ "$@" =~ \-\-intel ]]; then
arch_name="x86_64"
fi
# legacy app installation
if [ -d OBS.app ]; then
exec open OBS.app -W --args "$@"
fi
if [ "${arch_name}" = "x86_64" ]; then
exec open x86/OBS.app -W --args "$@"
elif [ "${arch_name}" = "arm64" ]; then
exec open arm64/OBS.app -W --args "$@"
else
echo "Unknown architecture: ${arch_name}"
fi