Created
November 21, 2016 21:57
-
-
Save lordcodes/221ae922ac97abdddc3dd18cccb96df1 to your computer and use it in GitHub Desktop.
Script to export your Unity package, written for use on Travis.
This file contains hidden or 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/sh | |
| project_path=$(pwd)/src/NAME_OF_PROJECT | |
| log_file=$(pwd)/build/unity-mac.log | |
| export_path=$(pwd)/current-package/NAME_OF_PROJECT.unitypackage | |
| error_code=0 | |
| echo "Creating package." | |
| /Applications/Unity/Unity.app/Contents/MacOS/Unity \ | |
| -batchmode \ | |
| -nographics \ | |
| -silent-crashes \ | |
| -logFile "$log_file" \ | |
| -projectPath "$project_path" \ | |
| -exportPackage "Assets/NAME_OF_LIBRARY" "$export_path" \ | |
| -quit | |
| if [ $? = 0 ] ; then | |
| echo "Created package successfully." | |
| error_code=0 | |
| else | |
| echo "Creating package failed. Exited with $?." | |
| error_code=1 | |
| fi | |
| echo 'Build logs:' | |
| cat $log_file | |
| echo "Finishing with code $error_code" | |
| exit $error_code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment