chiark / gitweb /
Check for cmddir earlier
authormartin f. krafft <madduck@debian.org>
Wed, 19 Nov 2008 15:08:02 +0000 (16:08 +0100)
committermartin f. krafft <madduck@debian.org>
Wed, 19 Nov 2008 19:12:19 +0000 (20:12 +0100)
Without cmddir, tg is basically useless, even do_help() needs it, so
check it first and die hard if not found

Signed-off-by: martin f. krafft <madduck@debian.org>
Acked-by: Petr Baudis <pasky@suse.cz>
tg.sh

diff --git a/tg.sh b/tg.sh
index 959f621ed9ac4cec251c31412a9696b051a1a8c5..9b93f1db17990effa6025b69fc62806c0b718f3f 100644 (file)
--- a/tg.sh
+++ b/tg.sh
@@ -236,6 +236,11 @@ do_help()
 }
 
 
+## Startup
+
+[ -d "@cmddir@" ] ||
+       die "No command directory: '@cmddir@'"
+
 ## Initial setup
 
 set -e
@@ -249,9 +254,6 @@ tg="tg"
 setup_ours
 setup_hook "pre-commit"
 
-[ -d "@cmddir@" ] ||
-       die "No command directory: '@cmddir@'"
-
 ## Dispatch
 
 # We were sourced from another script for our utility functions;