Skip to content

Instantly share code, notes, and snippets.

@lordcodes
Created November 21, 2016 21:57
Show Gist options
  • Select an option

  • Save lordcodes/221ae922ac97abdddc3dd18cccb96df1 to your computer and use it in GitHub Desktop.

Select an option

Save lordcodes/221ae922ac97abdddc3dd18cccb96df1 to your computer and use it in GitHub Desktop.
Script to export your Unity package, written for use on Travis.
#! /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