Last active
August 29, 2015 14:26
-
-
Save silverkorn/af2e55dbef1e7089af70 to your computer and use it in GitHub Desktop.
Gitflow (incl. AVH Edition) installer for Git For Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Gitflow (AVH Edition) installer for Git For Windows, by Danny Boisvert | |
# Licensed under the same restrictions as git-for-windows' build-extra: | |
# http://github.com/git-for-windows/build-extra/blob/master/git-extra/PKGBUILD | |
echo | |
echo "Installing Gitflow (AVH Edition) & Gitflow (AVH Edition) completion..." | |
echo | |
GITFLOW_REPO="gitflow" | |
GITFLOW_COMPLETION_REPO="git-flow-completion" | |
# Work in the `tmp/` directory | |
pushd "tmp" > /dev/null | |
# Gitflow repository | |
[ ! -d "tmp/gitflow" ] && git clone "https://github.com/petervanderdoes/${GITFLOW_REPO}.git" && DELETE_GITFLOW_REPO=1 | |
# Gitflow completion repository | |
[ ! -d "tmp/git-flow-completion" ] && git clone "https://github.com/petervanderdoes/${GITFLOW_COMPLETION_REPO}.git" && DELETE_GITFLOW_COMPLETION_REPO=1 | |
popd > /dev/null | |
# Apply to every "mingw" directories | |
for dir in $(ls -lA | gawk -F':[0-9]* ' '/:/{print $2}') | |
do | |
if [ ${dir:0:5} = "mingw" ]; | |
then | |
if [ -d "$dir" ]; | |
then | |
# Gitflow (AVH Edition) | |
pushd "tmp/gitflow" > /dev/null && \ | |
export PREFIX="../../${dir}" | |
bash -c "contrib/gitflow-installer.sh install stable" | |
popd > /dev/null | |
# Gitflow (AVH Edition) completion | |
pushd "tmp/git-flow-completion" > /dev/null && \ | |
cp -f git-flow-completion.* "../../${dir}/share/git/completion/" | |
popd > /dev/null | |
fi | |
fi | |
done | |
# Remove repositories if wasn't already there | |
[ "$DELETE_GITFLOW_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_REPO}" | |
[ "$DELETE_GITFLOW_COMPLETION_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_COMPLETION_REPO}" | |
echo | |
echo "Done." | |
echo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Gitflow installer for Git For Windows, by Danny Boisvert | |
# Licensed under the same restrictions as git-for-windows' build-extra: | |
# http://github.com/git-for-windows/build-extra/blob/master/git-extra/PKGBUILD | |
echo | |
echo "Installing Gitflow & Gitflow completion..." | |
echo | |
GITFLOW_REPO="gitflow" | |
GITFLOW_COMPLETION_REPO="git-flow-completion" | |
# Work in the `tmp/` directory | |
pushd "tmp" > /dev/null | |
# Gitflow repository | |
[ ! -d "tmp/gitflow" ] && git clone "https://github.com/nvie/${GITFLOW_REPO}.git" && DELETE_GITFLOW_REPO=1 | |
# Gitflow completion repository | |
[ ! -d "tmp/git-flow-completion" ] && git clone "https://github.com/bobthecow/${GITFLOW_COMPLETION_REPO}.git" && DELETE_GITFLOW_COMPLETION_REPO=1 | |
popd > /dev/null | |
# Apply to every "mingw" directories | |
for dir in $(ls -lA | gawk -F':[0-9]* ' '/:/{print $2}') | |
do | |
if [ ${dir:0:5} = "mingw" ]; | |
then | |
if [ -d "$dir" ]; | |
then | |
# Gitflow | |
pushd "tmp/gitflow" > /dev/null && \ | |
export INSTALL_PREFIX="../../${dir}/bin" | |
bash -c "contrib/gitflow-installer.sh install" | |
popd > /dev/null | |
# Gitflow completion | |
pushd "tmp/git-flow-completion" > /dev/null && \ | |
cp -f git-flow-completion.* "../../${dir}/share/git/completion/" | |
popd > /dev/null | |
fi | |
fi | |
done | |
# Remove repositories if wasn't already there | |
[ "$DELETE_GITFLOW_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_REPO}" | |
[ "$DELETE_GITFLOW_COMPLETION_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_COMPLETION_REPO}" | |
echo | |
echo "Done." | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment