user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] public-inbox-init: use absolute path
@ 2015-09-06  9:22 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-09-06  9:22 UTC (permalink / raw)
  To: meta

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.
---
 public-inbox-init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/public-inbox-init b/public-inbox-init
index 2d24402..a8f1dd7 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)};
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-06  9:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-06  9:22 [PATCH] public-inbox-init: use absolute path Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).