From ccbf6260ea1024a494406b46f22010f62471fc28 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Thu, 20 Jun 2013 17:39:08 -0400 Subject: [PATCH] Ajout script vb (version control list branches) --- scripts/Makefile.am | 2 +- scripts/vb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 scripts/vb 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 -- 2.20.1