summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-04-18 17:25:46 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-04-18 17:25:46 +0000
commit91f7bbb9ef2e6a81c51b61bf4b3466d833826e6e (patch)
treea0af6622e5f4500acc4c80487ceed0159c173e5b
parent06997a8032119c87ff8983d36c74ca638d14c237 (diff)
downloadMPC-91f7bbb9ef2e6a81c51b61bf4b3466d833826e6e.tar.gz
ChangeLogTag: Fri Apr 18 12:24:02 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/Driver.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/Driver.pm b/modules/Driver.pm
index 40b37853..8f4d43a5 100644
--- a/modules/Driver.pm
+++ b/modules/Driver.pm
@@ -40,7 +40,7 @@ sub new {
$self->{'path'} = $path;
$self->{'name'} = $name;
- $self->{'version'} = 1.8;
+ $self->{'version'} = 1.9;
$self->{'types'} = {};
$self->{'creators'} = \@creators;
$self->{'default'} = $creators[0];
@@ -288,6 +288,11 @@ sub run {
## To correctly reference any pathnames in the input file, chdir to
## its directory if there's any directory component to the specified path.
my($base) = basename($cfile);
+
+ if (-d $cfile) {
+ $base = '';
+ }
+
foreach my $name (@{$options->{'generators'}}) {
if (!$loaded{$name}) {
require "$name.pm";
@@ -307,7 +312,7 @@ sub run {
$options->{'toplevel'},
$options->{'baseprojs'});
if ($base ne $file) {
- my($dir) = dirname($file);
+ my($dir) = ($base eq '' ? $file : dirname($file));
if (!$generator->cd($dir)) {
print STDERR "ERROR: Unable to change to directory: $dir\n";
$status++;