From 1ad0a761f791663204e94a58c74329d58b59e5fb Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sun, 22 Apr 2012 19:03:07 +0530 Subject: [PATCH] install should fail more gracefully if the '-ln' directory does not exist thanks to EugeneKay for catching this --- install | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/install b/install index 1cf7853..ca6a864 100755 --- a/install +++ b/install @@ -20,14 +20,21 @@ Usage (from gitolite clone directory): ./install to run gitolite using an absolute or relative path, for example 'src/gitolite' or '/full/path/to/this/dir/src/gitolite' + ./install -ln [] to symlink just the gitolite executable to some that is in - $PATH. defauls to $HOME/bin if not specified. + $PATH. defaults to $HOME/bin if not specified. is + assumed to exist; gitolite will not create it. + + Please provide a full path, not a relative path. + ./install -to to copy the entire 'src' directory to . If is not in $PATH, use the full path to run gitolite commands. -Simplest use, if you have $HOME/bin in $PATH, is: + Please provide a full path, not a relative path. + +Simplest use, if $HOME/bin exists and is in $PATH, is: git clone -b g3 git://github.com/sitaramc/gitolite gitolite/install -ln @@ -46,6 +53,12 @@ GetOptions( ); usage() if $to and $ln or $help; $ln = "$ENV{HOME}/bin" if defined($ln) and not $ln; +for my $d ($ln, $to) { + if ($d and not -d $d) { + print STDERR "FATAL: '$d' does not exist.\n"; + usage(); + } +} chdir($ENV{GL_BINDIR}); my $version = `git describe --tags --long --dirty=-dt`;