Skip to content

Instantly share code, notes, and snippets.

@bryanmacfarlane
Last active May 16, 2016 00:51
Show Gist options
  • Save bryanmacfarlane/00ab2746bb1f1018db9e42fd3b144282 to your computer and use it in GitHub Desktop.
Save bryanmacfarlane/00ab2746bb1f1018db9e42fd3b144282 to your computer and use it in GitHub Desktop.
# ./git4win282.sh gitwin ~/Projects/gitwinout
git_repo_folder_name=$1
build_output_path=$2
BUILD_TAG="tags/v2.8.2.windows.1"
echo "Folder : ${git_repo_folder_name}"
echo "Output : ${build_output_path}"
function banner()
{
echo -------------------------------------------------------
echo $1
echo -------------------------------------------------------
}
function failed()
{
local error=${1:-Undefined error}
echo "Failed: $error" >&2
exit 1
}
banner "Getting code @ ${BUILD_TAG}"
if [ ! -d "${git_repo_folder_name}" ]; then
git clone https://github.com/git-for-windows/git "${git_repo_folder_name}" || failed "git clone"
fi
pushd ${git_repo_folder_name}
git checkout "${BUILD_TAG}" || failed "git checkout ${BUILD_TAG}"
banner "Cleaning"
git clean -fdx || failed "git clean"
rm -rf "${build_output_path}" || "rm"
banner "Configure"
make configure || failed "make configure"
./configure --prefix=${build_output_path} || failed "configure"
banner "Building"
make prefix=${build_output_path} || failed "make"
banner "Installing to ${build_output_path}"
mkdir ${build_output_path} || failed "mkdir"
make prefix=${build_output_path} install || failed "make install"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment