36 lines
925 B
Bash
36 lines
925 B
Bash
#!/bin/bash
|
|
SERIAL=$1; EMAIL=$2; PASSWORD=$3; COMMAND=$4; UNITY_BUILDER=$5
|
|
DEFAULT_ARGS="-quit -logFile -"
|
|
|
|
rm -rf $HOME/.config/unity3d
|
|
rm -rf /home/unity/.config/unity3d
|
|
|
|
#Add ssh key information for resolving packages.
|
|
bash /scripts/add_ssh_keys.sh
|
|
|
|
if [[ "$SERIAL" != "activated" ]]; then
|
|
echo "::group::Activating Unity License"
|
|
bash /scripts/activate_license.sh "$SERIAL" "$EMAIL" "$PASSWORD"
|
|
echo "::endgroup::"
|
|
fi
|
|
|
|
echo "::group::Running Unity Command"
|
|
#Run the command.
|
|
if [[ -n "$UNITY_BUILDER" ]]; then
|
|
echo "Using UnityBuilder to run the command:"
|
|
echo " UnityBuilder $COMMAND"
|
|
UnityBuilder $COMMAND
|
|
else
|
|
echo "Using unity-editor to run the command:"
|
|
echo " unity-editor $DEFAULT_ARGS $COMMAND"
|
|
unity-editor $DEFAULT_ARGS $COMMAND
|
|
fi
|
|
RESULT=$?
|
|
echo "::endgroup::"
|
|
|
|
echo "exitCode=$RESULT" >> "$GITHUB_OUTPUT"
|
|
|
|
if [[ "$CATCH_ERRORS" != "true" ]]; then
|
|
exit $RESULT
|
|
fi
|