From 4170baeabe2d94cdddadc73889656c5fb2c02f17 Mon Sep 17 00:00:00 2001 From: will Date: Sun, 6 Aug 2000 02:51:30 +0000 Subject: Fix special case where people use ``.'' for the argument to -d. I'm not very good with perl yet, so anyone who can propose a better way to do this (with s/// or m// or something using regex) that might also include the case where the argument contains slashes (i.e. games/somegame). But anyways, this should catch folks who use ``.''. :-> Submitted by: obrien, sada --- Tools/scripts/addport | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Tools/scripts') diff --git a/Tools/scripts/addport b/Tools/scripts/addport index c8eba80582e0..e8760c10d001 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -161,13 +161,18 @@ END { } } - if ($dir eq "") { warnx("Please specify a directory to import a new port from."); usage(); exit 1; } +# account for special case +if ($dir eq ".") { + chomp(local $pwd = `pwd`); + $dir = `basename $pwd`; +} + $dir = "$pwd/$dir" if ($dir !~ m,^/,); $dir =~ s,/$,,g; -- cgit