Skip to content

Commit 8384a60

Browse files
committed
install.sh: Fix up the Rosetta workaround
Looks like we're running into the env vars disappearing thing again. Just re-launch the whole script... Signed-off-by: Hector Martin <[email protected]>
1 parent 2594aee commit 8384a60

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
set -e
55

6+
cd "$(dirname "$0")"
7+
68
export LC_ALL=UTF-8
79
export LANG=UTF-8
810

@@ -14,8 +16,6 @@ export SSL_CERT_FILE=$PWD/Frameworks/Python.framework/Versions/Current/etc/opens
1416
# so do it again for good measure.
1517
export PATH="$PWD/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
1618

17-
arch=
18-
1919
if ! arch -arm64 ls >/dev/null 2>/dev/null; then
2020
echo
2121
echo "Looks like this is an Intel Mac!"
@@ -28,8 +28,10 @@ if [ $(arch) != "arm64" ]; then
2828
echo
2929
echo "You're running the installer in Intel mode under Rosetta!"
3030
echo "Don't worry, we can fix that for you. Switching to ARM64 mode..."
31-
arch="arch -arm64"
31+
32+
# This loses env vars in some security states, so just re-launch ourselves
33+
exec arch -arm64 ./install.sh
3234
fi
3335

3436
exec </dev/tty >/dev/tty 2>/dev/tty
35-
exec $arch $python main.py "$@"
37+
exec $python main.py "$@"

0 commit comments

Comments
 (0)