install should fail more gracefully if the '-ln' directory does not exist

thanks to EugeneKay for catching this
This commit is contained in:
Sitaram Chamarty 2012-04-22 19:03:07 +05:30
parent c3ec518cef
commit 1ad0a761f7

17
install
View file

@ -20,14 +20,21 @@ Usage (from gitolite clone directory):
./install ./install
to run gitolite using an absolute or relative path, for example to run gitolite using an absolute or relative path, for example
'src/gitolite' or '/full/path/to/this/dir/src/gitolite' 'src/gitolite' or '/full/path/to/this/dir/src/gitolite'
./install -ln [<dir>] ./install -ln [<dir>]
to symlink just the gitolite executable to some <dir> that is in to symlink just the gitolite executable to some <dir> that is in
$PATH. <dir> defauls to $HOME/bin if <dir> not specified. $PATH. <dir> defaults to $HOME/bin if <dir> not specified. <dir> is
assumed to exist; gitolite will not create it.
Please provide a full path, not a relative path.
./install -to <dir> ./install -to <dir>
to copy the entire 'src' directory to <dir>. If <dir> is not in to copy the entire 'src' directory to <dir>. If <dir> is not in
$PATH, use the full path to run gitolite commands. $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 git clone -b g3 git://github.com/sitaramc/gitolite
gitolite/install -ln gitolite/install -ln
@ -46,6 +53,12 @@ GetOptions(
); );
usage() if $to and $ln or $help; usage() if $to and $ln or $help;
$ln = "$ENV{HOME}/bin" if defined($ln) and not $ln; $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}); chdir($ENV{GL_BINDIR});
my $version = `git describe --tags --long --dirty=-dt`; my $version = `git describe --tags --long --dirty=-dt`;