Mac: handle detached HEAD

This commit is contained in:
Benitoite 2023-03-08 15:07:57 -08:00 committed by GitHub
parent ec19698dc4
commit f92dca3e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -447,7 +447,11 @@ function CreateDmg {
cp "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_macOS_${arch}_latest.zip"
fi
if [[ -n $CONTINUOUS ]]; then
mv "${PROJECT_NAME}_macOS_${arch}_latest.zip" "${PROJECT_NAME}_$(git branch --show-current)_macOS_${CMAKE_BUILD_TYPE}.zip"
BRANCH=$(git branch --show-current)
if test -z "${BRANCH}"
BRANCH=$(git rev-parse --short HEAD)
fi
mv "${PROJECT_NAME}_macOS_${arch}_latest.zip" "${PROJECT_NAME}_${BRANCH}_macOS_${CMAKE_BUILD_TYPE}.zip"
fi
}