Last active
November 24, 2021 23:29
-
-
Save vhd/5f3824cb1a463a51e4c2532835ed5b02 to your computer and use it in GitHub Desktop.
Patch for Steam version of Farming Simulator 22 on Apple M1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FS22PATH=~/Library/Application\ Support/Steam/steamapps/common/Farming\ Simulator\ 22/Farming\ Simulator\ 2022.app/Contents/MacOS | |
FILE1=${FS22PATH}/FarmingSimulator2022Game | |
FILE2=${FS22PATH}/FarmingSimulator2022Game_ | |
FILE_ESC=$(printf %q "$FILE2") | |
IS_SCRIPT=$(file "$FILE1" | grep "POSIX shell script") | |
IS_BINARY=$(file "$FILE1" | grep "universal binary") | |
if [ -n "$IS_SCRIPT" ]; then | |
echo "Already patched" | |
elif [ -n "$IS_BINARY" ]; then | |
echo "Binary found. Replacing with launcher..." | |
mv "$FILE1" "$FILE2" | |
echo "#!/bin/sh" > "$FILE1" | |
echo "arch -arm64 $FILE_ESC" >> "$FILE1" | |
chmod +x "$FILE1" | |
else | |
echo "Something went wrong. Run integrity check and try again" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment