From 3ebdb0e6788e6b438396b6eb37b348d88db2a2f4 Mon Sep 17 00:00:00 2001 From: Webber Takken Date: Tue, 31 Aug 2021 01:18:34 +0200 Subject: [PATCH] Run license activation in an empty directory (#285) --- dist/entrypoint.sh | 13 +++++++++++++ dist/steps/activate.sh | 7 +++++++ dist/steps/return_license.sh | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/dist/entrypoint.sh b/dist/entrypoint.sh index d3dfe6553..4841be00d 100755 --- a/dist/entrypoint.sh +++ b/dist/entrypoint.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash +# +# Create directory for license activation +# + +ACTIVATE_LICENSE_PATH="$GITHUB_WORKSPACE/_activate-license" +mkdir -p "$ACTIVATE_LICENSE_PATH" + # # Run steps # @@ -8,6 +15,12 @@ source /steps/activate.sh source /steps/build.sh source /steps/return_license.sh +# +# Remove license activation directory +# + +rm -r "$ACTIVATE_LICENSE_PATH" + # # Instructions for debugging # diff --git a/dist/steps/activate.sh b/dist/steps/activate.sh index 33cfc65c4..d2bb570d0 100755 --- a/dist/steps/activate.sh +++ b/dist/steps/activate.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Run in ACTIVATE_LICENSE_PATH directory +echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory." +pushd "$ACTIVATE_LICENSE_PATH" + if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then # # PERSONAL LICENSE MODE @@ -98,3 +102,6 @@ else echo "Exit code was: $UNITY_EXIT_CODE" exit $UNITY_EXIT_CODE fi + +# Return to previous working directory +popd diff --git a/dist/steps/return_license.sh b/dist/steps/return_license.sh index ff2328af7..c5bb721ff 100755 --- a/dist/steps/return_license.sh +++ b/dist/steps/return_license.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Run in ACTIVATE_LICENSE_PATH directory +echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory." +pushd "$ACTIVATE_LICENSE_PATH" + if [[ -n "$UNITY_SERIAL" ]]; then # # PROFESSIONAL (SERIAL) LICENSE MODE @@ -11,3 +15,6 @@ if [[ -n "$UNITY_SERIAL" ]]; then -quit \ -returnlicense fi + +# Return to previous working directory +popd