mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 16:45:44 +00:00
fix: make generate.sh work with git worktrees
This commit is contained in:
parent
da90bbd356
commit
ba4cb85639
13
generate.sh
13
generate.sh
@ -46,13 +46,18 @@ function install_premake {
|
|||||||
chmod +x build/premake5
|
chmod +x build/premake5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function expect_inside_git_repository {
|
||||||
|
inside_git_repo="$(git rev-parse --is-inside-work-tree 2>/dev/null)"
|
||||||
|
if [ ! -d ".git" ] && [ ! "$inside_git_repo" ]; then
|
||||||
|
echo "You must clone the OpenAssetTools repository using 'git clone'. Please read README.md." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Go to repository root
|
# Go to repository root
|
||||||
cd "$(dirname "$0")" || exit 2
|
cd "$(dirname "$0")" || exit 2
|
||||||
|
|
||||||
if [[ ! -d ".git" ]]; then
|
expect_inside_git_repository
|
||||||
echo "You must clone the OpenAssetTools repository using 'git clone'. Please read README.md." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
PREMAKE_BIN=''
|
PREMAKE_BIN=''
|
||||||
if [[ -z "$PREMAKE_NO_GLOBAL" ]] && [[ -x "$(command -v premake5)" ]]; then
|
if [[ -z "$PREMAKE_NO_GLOBAL" ]] && [[ -x "$(command -v premake5)" ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user