Fix indentation and slightly improve readability in activate.sh

This commit is contained in:
Gabriel Le Breton 2023-09-19 14:28:29 -04:00 committed by GitHub
parent cfe4a6236a
commit 3bf512a9a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,22 +7,25 @@ pushd "$ACTIVATE_LICENSE_PATH"
echo "Requesting activation" echo "Requesting activation"
if [[ -n "$UNITY_LICENSING_SERVER" ]]; then if [[ -n "$UNITY_LICENSING_SERVER" ]]; then
# #
# Custom Unity License Server # Custom Unity License Server
# #
echo "Adding licensing server config" echo "Adding licensing server config"
mkdir -p "/Library/Application Support/Unity/config/" mkdir -p "/Library/Application Support/Unity/config/"
cp "$ACTION_FOLDER/unity-config/services-config.json" "/Library/Application Support/Unity/config/services-config.json" cp \
/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt "$ACTION_FOLDER/unity-config/services-config.json" \
PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') "/Library/Application Support/Unity/config/services-config.json"
grep -oE '\".*?\"' < license.txt /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client \
export FLOATING_LICENSE --acquire-floating > license.txt
FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"')
FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") grep -oE '\".*?\"' < license.txt
export FLOATING_LICENSE
FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE")
FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE")
echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT"
# Store the exit code from the verify command # Store the exit code from the verify command
UNITY_EXIT_CODE=$? UNITY_EXIT_CODE=$?
else else
# Activate license # Activate license
/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \