]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/CLI.pm
+ some TT2 options need to be set on the Template::Provider
[maypole.git] / lib / Maypole / CLI.pm
index 81a2fd5083b2e2d4d10908895ae1ad7fa8af04fa..3839521e2d8112e03bb8eb9971551a28f691843c 100644 (file)
@@ -29,9 +29,10 @@ sub get_template_root { $ENV{MAYPOLE_TEMPLATES} || "." }
 sub parse_location {
     my $self = shift;
     my $url  = URI->new( shift @ARGV );
-    my $root = URI->new( $self->config->uri_base )->path;
+    (my $uri_base = $self->config->uri_base) =~ s:/$::;
+    my $root = URI->new( $uri_base )->path;
     $self->{path} = $url->path;
-    $self->{path} =~ s/^$root//i if $root;
+    $self->{path} =~ s:^$root/?::i if $root;
     $self->parse_path;
     $self->parse_args($url);
 }