#!/bin/sh
# git-flow make-less installer for *nix systems, by Rick Osborne
# Based on the git-flow core Makefile:
# http://github.com/nvie/gitflow/blob/master/Makefile
# Licensed under the same restrictions as git-flow:
# http://github.com/nvie/gitflow/blob/develop/LICENSE
# Does this need to be smarter for each host OS?
if [ -z "$INSTALL_PREFIX" ] ; then
INSTALL_PREFIX="/usr/local/bin"
fi
if [ -z "$REPO_NAME" ] ; then
REPO_NAME="gitflow"
fi
if [ -z "$REPO_HOME" ] ; then
REPO_HOME="http://github.com/nvie/gitflow.git"
fi
EXEC_FILES="git-flow"
SCRIPT_FILES="git-flow-init git-flow-feature git-flow-hotfix git-flow-release git-flow-support git-flow-version gitflow-common gitflow-shFlags"
SUBMODULE_FILE="gitflow-shFlags"
echo "### gitflow no-make installer ###"
case "$1" in
uninstall)
echo "Uninstalling git-flow from $INSTALL_PREFIX"
if [ -d "$INSTALL_PREFIX" ] ; then
for script_file in $SCRIPT_FILES $EXEC_FILES ; do
echo "rm -vf $INSTALL_PREFIX/$script_file"
rm -vf "$INSTALL_PREFIX/$script_file"
done
else
echo "The '$INSTALL_PREFIX' directory was not found."
echo "Do you need to set INSTALL_PREFIX ?"
fi
exit
;;
help)
echo "Usage: [environment] gitflow-installer.sh [install|uninstall]"
echo "Environment:"
echo " INSTALL_PREFIX=$INSTALL_PREFIX"
echo " REPO_HOME=$REPO_HOME"
echo " REPO_NAME=$REPO_NAME"
exit
;;
*)
echo "Installing git-flow to $INSTALL_PREFIX"
if [[ -d "$REPO_NAME" && -d "$REPO_NAME/.git" ]] ; then
echo "Using existing repo: $REPO_NAME"
else
echo "Cloning repo from GitHub to $REPO_NAME"
git clone "$REPO_HOME" "$REPO_NAME"
fi
if [ -f "$REPO_NAME/$SUBMODULE_FILE" ] ; then
echo "Submodules look up to date"
else
echo "Updating submodules"
lastcwd=$PWD
cd "$REPO_NAME"
git submodule init
git submodule update
cd "$lastcwd"
fi
install -v -d -m 0755 "$INSTALL_PREFIX"
for exec_file in $EXEC_FILES ; do
install -v -m 0755 "$REPO_NAME/$exec_file" "$INSTALL_PREFIX"
done
for script_file in $SCRIPT_FILES ; do
install -v -m 0644 "$REPO_NAME/$script_file" "$INSTALL_PREFIX"
done
exit
;;
esac
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
gitflow-master.zip (16个子文件)
gitflow-master
gitflow-shFlags 19B
Makefile 2KB
AUTHORS 310B
LICENSE 1KB
gitflow-common 9KB
git-flow-release 10KB
git-flow-support 5KB
git-flow 3KB
bump-version 405B
git-flow-init 10KB
git-flow-version 2KB
.gitmodules 79B
git-flow-hotfix 9KB
git-flow-feature 14KB
shFlags
Changes.mdown 2KB
contrib
gitflow-installer.sh 2KB
共 16 条
- 1
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6656
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功