diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-09-11 22:24:45 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-09-11 22:24:45 +0200 |
commit | 533e54d2133751acbce548c08cbdeb6a418125ff (patch) | |
tree | cffba00cd59e0aa00d6a4a505902b029a3f48b7f /git-synk | |
parent | 0353ceca365d5d0b4fb50a2e2d92ccfc819a0e8a (diff) | |
download | bin-533e54d2133751acbce548c08cbdeb6a418125ff.zip bin-533e54d2133751acbce548c08cbdeb6a418125ff.tar.gz |
git-synk: replace GIT_DIR by REPOS_PATHS and option -d --git-dir by -p --repos-paths
Diffstat (limited to 'git-synk')
-rwxr-xr-x | git-synk | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -2,7 +2,7 @@ function help() { echo "${0##*/} [drbs] [push|pull] [remote]" - echo -e "-d --git-dir set GIT_DIR" + echo -e "-p --repos-paths set REPOS_PATHS" echo -e "-r --git-remote set GIT_REMOTE" echo -e "-b --git-branch set GIT_BRANCH" echo -e "-s --use-stash set USE_STASH" @@ -17,7 +17,7 @@ for arg in $@; do case "$option" in pull) action="pull";; push) action="push";; - -d|--git-dir) GIT_DIR=$value;; + -p|--repos-paths) REPOS_PATHS=$value;; -r|--git-remote) GIT_REMOTE=$value;; -b|--git-branch) GIT_BRANCH=$value;; -s|--use-stash) USE_STASH=1;; @@ -26,7 +26,7 @@ for arg in $@; do esac done -GIT_DIR=${GIT_DIR:-$HOME/usr/git} +REPOS_PATHS=${REPOS_PATHS:-$HOME/usr/git} GIT_REMOTE=${GIT_REMOTE:-origin} GIT_BRANCH=${GIT_BRANCH:-master} USE_STASH=${USE_STASH:-0} @@ -93,10 +93,10 @@ function push() { } echo -e "remote:${YELLOW}${GIT_REMOTE}${RESET}:${PURPLE}${GIT_BRANCH}${RESET} USE_STASH=${RED}${USE_STASH}${RESET}" -for gitdir in ${GIT_DIR}; do - echo -e "enter ${BROWN}${gitdir}${RESET}" && cd ${gitdir} || return 1 +for path in ${REPOS_PATHS}; do + echo -e "enter ${BROWN}${path}${RESET}" && cd ${path} || return 1 for dir in $(ls -1); do - cd ${gitdir} + cd ${path} STASH=0 [ -d ${dir} ] && [ -e ${dir}/.git/config ] || continue echo -e " enter ${BROWN}${dir}${RESET}" && cd $dir || exit 1 @@ -107,5 +107,5 @@ for gitdir in ${GIT_DIR}; do push || continue echo -e " leave ${BROWN}${dir}${RESET}\n" done - echo -e "leave ${BROWN}${gitdir}${RESET}" + echo -e "leave ${BROWN}${path}${RESET}" done |