Last active
February 27, 2016 23:40
-
-
Save johndalton/55c9364890d15e21f814 to your computer and use it in GitHub Desktop.
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 | |
ksp="$HOME/Library/Application Support/Steam/SteamApps/common/Kerbal Space Program/KSP.app/Contents" | |
unity="/Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/Variations/macosx64_nondevelopment_mono/UnityPlayer.app/Contents" | |
transfer() { | |
# Take an optional destination argument in case the destination file has a different name. | |
if [ "Z$2" != "Z" ] | |
then | |
dest=$2 | |
else | |
dest=$1 | |
fi | |
mv "$ksp/$dest" "$ksp/$dest.bak" | |
cp "$unity/$1" "$ksp/$dest" | |
} | |
transfer "Data/Managed/UnityEngine.dll" | |
transfer "Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib" | |
transfer "Frameworks/MonoEmbedRuntime/osx/libMonoPosixHelper.dylib" | |
transfer "MacOS/UnityPlayer" "MacOS/KSP" |
^ for bonus points you shouldn't run the backup mv twice if the destination file already exists so that if you run the script twice it doesn't overwrite the backed up files.
should also probably use \mv
and \cp` to bypass aliases and be explicit about your preferences for -i and -f arguments... (mv -i would be one way to avoid overwriting, but that being the default behavior of the shell is dependent upon the user's aliases).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script from reddit user aperlscript in this comment:
https://www.reddit.com/r/KerbalSpaceProgram/comments/3gcltc/64bit_ksp_on_os_x/ctxefw5