From e3eae5b07e6a4f7bd21135523694edad9214bd6e Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:45:19 -0800 Subject: [PATCH] Only use sudo to create unity license directory if it doesn't already exist. Don't delete license dir after action exits --- dist/platforms/mac/entrypoint.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/platforms/mac/entrypoint.sh b/dist/platforms/mac/entrypoint.sh index 37cf7a4b..ccfac037 100755 --- a/dist/platforms/mac/entrypoint.sh +++ b/dist/platforms/mac/entrypoint.sh @@ -4,8 +4,12 @@ # Create directories for license activation # -sudo mkdir /Library/Application\ Support/Unity -sudo chmod -R 777 /Library/Application\ Support/Unity +$UNITY_LICENSE_PATH="/Library/Application\ Support/Unity" + +if [ -d "$UNITY_LICENSE_PATH"] + sudo mkdir "$UNITY_LICENSE_PATH" + sudo chmod -R 777 "$UNITY_LICENSE_PATH" +fi ACTIVATE_LICENSE_PATH="$ACTION_FOLDER/BlankProject" mkdir -p "$ACTIVATE_LICENSE_PATH" @@ -21,7 +25,6 @@ source $ACTION_FOLDER/platforms/mac/steps/return_license.sh # Remove license activation directory # -sudo rm -r /Library/Application\ Support/Unity rm -r "$ACTIVATE_LICENSE_PATH" #