Skip to content
This repository
Browse code

Added Rick Osborne's super-easy gitflow installer oneliner to the pro…

…ject.

See the README file for instructions on how to use it.
  • Loading branch information...
commit 4f0f539130e0a4ab7883701dfd43fd8aec6799fc 1 parent f68d405
Vincent Driessen authored

Showing 3 changed files with 85 additions and 0 deletions. Show diff stats Hide diff stats

  1. +1 0  AUTHORS
  2. +6 0 README.mdown
  3. +78 0 contrib/gitflow-installer.sh
1  AUTHORS
@@ -5,5 +5,6 @@ Authors are (ordered by first commit date):
5 5 - Daniel Truemper
6 6 - Jason L. Shiffer
7 7 - Randy Merrill
  8 +- Rick Osborne
8 9
9 10 Portions derived from other open source works are clearly marked.
6 README.mdown
Source Rendered
@@ -12,6 +12,12 @@ blog post").
12 12
13 13 Installing git-flow
14 14 -------------------
  15 +The easiest way to install git-flow is using Rick Osborne's excellent
  16 +git-flow installer, which can be run using the following command:
  17 +
  18 + $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
  19 +
  20 +If you prefer a manual installation, please use the following instructions.
15 21 After downloading the sources from Github, also fetch the submodules:
16 22
17 23 $ git submodule init
78 contrib/gitflow-installer.sh
... ... @@ -0,0 +1,78 @@
  1 +#!/bin/sh
  2 +
  3 +# git-flow make-less installer for *nix systems, by Rick Osborne
  4 +# Based on the git-flow core Makefile:
  5 +# http://github.com/nvie/gitflow/blob/master/Makefile
  6 +
  7 +# Licensed under the same restrictions as git-flow:
  8 +# http://github.com/nvie/gitflow/blob/develop/LICENSE
  9 +
  10 +# Does this need to be smarter for each host OS?
  11 +if [ -z "$INSTALL_PREFIX" ] ; then
  12 + INSTALL_PREFIX="/usr/local/bin"
  13 +fi
  14 +
  15 +if [ -z "$REPO_NAME" ] ; then
  16 + REPO_NAME="gitflow"
  17 +fi
  18 +
  19 +if [ -z "$REPO_HOME" ] ; then
  20 + REPO_HOME="http://github.com/nvie/gitflow.git"
  21 +fi
  22 +
  23 +EXEC_FILES="git-flow"
  24 +SCRIPT_FILES="git-flow-init git-flow-feature git-flow-hotfix git-flow-release git-flow-support git-flow-version gitflow-common gitflow-shFlags"
  25 +SUBMODULE_FILE="gitflow-shFlags"
  26 +
  27 +echo "### gitflow no-make installer ###"
  28 +
  29 +case "$1" in
  30 + uninstall)
  31 + echo "Uninstalling git-flow from $INSTALL_PREFIX"
  32 + if [ -d "$INSTALL_PREFIX" ] ; then
  33 + for script_file in $SCRIPT_FILES $EXEC_FILES ; do
  34 + echo "rm -vf $INSTALL_PREFIX/$script_file"
  35 + rm -vf "$INSTALL_PREFIX/$script_file"
  36 + done
  37 + else
  38 + echo "The '$INSTALL_PREFIX' directory was not found."
  39 + echo "Do you need to set INSTALL_PREFIX ?"
  40 + fi
  41 + exit
  42 + ;;
  43 + help)
  44 + echo "Usage: [environment] gitflow-installer.sh [install|uninstall]"
  45 + echo "Environment:"
  46 + echo " INSTALL_PREFIX=$INSTALL_PREFIX"
  47 + echo " REPO_HOME=$REPO_HOME"
  48 + echo " REPO_NAME=$REPO_NAME"
  49 + exit
  50 + ;;
  51 + *)
  52 + echo "Installing git-flow to $INSTALL_PREFIX"
  53 + if [[ -d "$REPO_NAME" && -d "$REPO_NAME/.git" ]] ; then
  54 + echo "Using existing repo: $REPO_NAME"
  55 + else
  56 + echo "Cloning repo from GitHub to $REPO_NAME"
  57 + git clone "$REPO_HOME" "$REPO_NAME"
  58 + fi
  59 + if [ -f "$REPO_NAME/$SUBMODULE_FILE" ] ; then
  60 + echo "Submodules look up to date"
  61 + else
  62 + echo "Updating submodules"
  63 + lastcwd=$PWD
  64 + cd "$REPO_NAME"
  65 + git submodule init
  66 + git submodule update
  67 + cd "$lastcwd"
  68 + fi
  69 + install -v -d -m 0755 "$INSTALL_PREFIX"
  70 + for exec_file in $EXEC_FILES ; do
  71 + install -v -m 0755 "$REPO_NAME/$exec_file" "$INSTALL_PREFIX"
  72 + done
  73 + for script_file in $SCRIPT_FILES ; do
  74 + install -v -m 0644 "$REPO_NAME/$script_file" "$INSTALL_PREFIX"
  75 + done
  76 + exit
  77 + ;;
  78 +esac

0 comments on commit 4f0f539

Please sign in to comment.
Something went wrong with that request. Please try again.