2014-11-14 16:58:40 -05:00
|
|
|
#!/bin/bash
|
2016-12-08 08:52:44 -05:00
|
|
|
# Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
2014-11-04 16:10:57 -05:00
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
cd "`dirname "$0"`"
|
|
|
|
|
|
|
|
|
|
if [ ! -f Engine/Binaries/DotNET/GitDependencies.exe ]; then
|
|
|
|
|
echo "GitSetup ERROR: This script does not appear to be located \
|
|
|
|
|
in the root UE4 directory and must be run from there."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2014-11-11 09:46:28 -05:00
|
|
|
if [ "$(uname)" = "Darwin" ]; then
|
2014-11-11 13:00:43 -05:00
|
|
|
# Setup the git hooks
|
|
|
|
|
if [ -d .git/hooks ]; then
|
|
|
|
|
echo "Registering git hooks... (this will override existing ones!)"
|
|
|
|
|
rm -f .git/hooks/post-checkout
|
|
|
|
|
rm -f .git/hooks/post-merge
|
|
|
|
|
ln -s ../../Engine/Build/BatchFiles/Mac/GitDependenciesHook.sh .git/hooks/post-checkout
|
|
|
|
|
ln -s ../../Engine/Build/BatchFiles/Mac/GitDependenciesHook.sh .git/hooks/post-merge
|
|
|
|
|
fi
|
2014-11-04 16:10:57 -05:00
|
|
|
|
2014-11-11 13:00:43 -05:00
|
|
|
# Get the dependencies for the first time
|
2014-11-12 14:02:02 -05:00
|
|
|
Engine/Build/BatchFiles/Mac/GitDependencies.sh --prompt $@
|
2014-11-11 13:00:43 -05:00
|
|
|
else
|
|
|
|
|
# Setup the git hooks
|
|
|
|
|
if [ -d .git/hooks ]; then
|
|
|
|
|
echo "Registering git hooks... (this will override existing ones!)"
|
|
|
|
|
echo \#!/bin/sh >.git/hooks/post-checkout
|
2015-01-26 13:22:53 -05:00
|
|
|
echo Engine/Build/BatchFiles/Linux/GitDependencies.sh >>.git/hooks/post-checkout
|
2014-11-11 13:00:43 -05:00
|
|
|
chmod +x .git/hooks/post-checkout
|
|
|
|
|
|
|
|
|
|
echo \#!/bin/sh >.git/hooks/post-merge
|
2015-01-26 13:22:53 -05:00
|
|
|
echo Engine/Build/BatchFiles/Linux/GitDependencies.sh >>.git/hooks/post-merge
|
2014-11-11 13:00:43 -05:00
|
|
|
chmod +x .git/hooks/post-merge
|
|
|
|
|
fi
|
|
|
|
|
|
2014-11-14 16:58:40 -05:00
|
|
|
pushd Engine/Build/BatchFiles/Linux > /dev/null
|
|
|
|
|
./Setup.sh "$@"
|
|
|
|
|
popd > /dev/null
|
2014-11-11 13:00:43 -05:00
|
|
|
fi
|