From: Eric Wong Date: Sun, 6 Sep 2015 07:15:26 +0000 (+0000) Subject: public-inbox-init: use absolute path X-Git-Tag: v1.0.0~895 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2a2973d2774cb104d0a5a06e2febad8db10b39eb;p=public-inbox.git public-inbox-init: use absolute path We actually have no business expanding (e.g. translating ~ to $HOME) paths from the command-line argument, the shell does that. However, we need to make the path absolute instead. --- diff --git a/public-inbox-init b/public-inbox-init index 8847eb68..d6a63822 100755 --- a/public-inbox-init +++ b/public-inbox-init @@ -8,7 +8,7 @@ use PublicInbox::Config; use File::Temp qw/tempfile/; use File::Basename qw/dirname/; use File::Path qw/mkpath/; -use File::Path::Expand qw/expand_filename/; +use Cwd qw/abs_path/; sub x { system(@_) and die join(' ', @_). " failed: $?\n" } sub usage { print STDERR "Usage: $usage\n"; exit 1 } @@ -59,7 +59,7 @@ close $fh or die "failed to close $filename: $!\n"; my $pfx = "publicinbox.$name"; my @x = (qw/git config/, "--file=$filename"); -$git_dir = expand_filename($git_dir); +$git_dir = abs_path($git_dir); x(qw(git init -q --bare), $git_dir); foreach my $addr (@address) { next if $seen{lc($addr)};