From: Hugo Villeneuve Date: Thu, 20 Jun 2013 21:39:08 +0000 (-0400) Subject: Ajout script vb (version control list branches) X-Git-Url: http://gitweb.hugovil.com/?p=hvutilities.git;a=commitdiff_plain;h=ccbf6260ea1024a494406b46f22010f62471fc28 Ajout script vb (version control list branches) --- diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 476da1f..63baeb0 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -18,7 +18,7 @@ dist_bin_SCRIPTS = \ setdate \ strip-debug-symbols \ tildes-clean \ - vd vs vl \ + vb vd vl vs \ flac2ogg flac2mp3 \ hv-scan \ tape-backup tape-backup-mult tape-list tape-restore diff --git a/scripts/vb b/scripts/vb new file mode 100755 index 0000000..8473adf --- /dev/null +++ b/scripts/vb @@ -0,0 +1,23 @@ +#!/bin/bash + +VCS_SUPPORTED="GIT or Mercurial" + +print_usage() +{ + echo "$(basename $0) -- branches list for version control (${VCS_SUPPORTED})." + echo "Usage: $(basename $0) [OPTIONS...]" +} + +if [ "x${1}" = "x--help" ]; then + print_usage + exit 1 +fi + +if git diff 1> /dev/null 2>&1; then + git branch -a "$@" +elif hg status 1> /dev/null 2>&1; then + hg branches "$@" +else + echo "Not a ${VCS_SUPPORTED} repository" + exit 1 +fi