Skip to content

Instantly share code, notes, and snippets.

@benwurth
Created January 20, 2015 19:15
Show Gist options
  • Save benwurth/a0ef3998af60a1130df8 to your computer and use it in GitHub Desktop.
Save benwurth/a0ef3998af60a1130df8 to your computer and use it in GitHub Desktop.
UniMerge mac-driver
#!/bin/bash
## Matt Schoen
## 5-29-2013
##
## In the absence of a legitimate license (that I know of) that fits my needs, here goes: This software is the
## copyrighted material of its author, Matt Schoen, and his comapny Defective Studios. It is available for sale on
## the Unity Asset store and is subject to their restrictions and limitations, as well as the following: You shall not
## reproduce or re-distribute this software with the express written (e-mail is fine) permission of the author. If
## permission is granted, the code (this file and related files) must bear this license in its entirety. Anyone who
## purchases the script is welcome to modify end re-use the code at their personal risk and under the condition that
## it not be included in any disribution builds. The software is provided as-is without warranty and the author bears
## no responsiblity for damages or losses caused by the software. Enjoy it, it's yours, but just don't try to profit
## from it, OK?
## Converted to Bash for Mac OSX by Ben Wurth
## 1-13-2015
## BenWurth.com
if [ "$#" -lt "4" ]
then
for i in $#; do
echo $i
done
echo "Usage: merge-unity-mac.sh merged.doc theirs.doc mine.doc base.doc"
exit 0
fi
sMergedDoc=$1
sTheirDoc=$2
sMyDoc=$3
sBaseDoc=$4
## If Unity is running, add the text file in the proper location
unityRunning=$(ps -ef | grep "Unity" | grep -v "grep" | wc -l)
if [ "$unityRunning" -gt 0 ]
then
fileName="./Assets/merges.txt"
touch $fileName
echo "$sMyDoc" >> "$fileName"
echo "$sTheirDoc" >> "$fileName"
else
echo "Unity is not running."
fi
## If Unity is not running, start it with parameters to launch UniMerge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment