Subject: | Breaks on standard windows home directories. |
Date: | Mon, 18 Sep 2006 17:10:07 -0400 |
To: | <bug-Module-Starter-PBP [...] rt.cpan.org> |
From: | "Jim Graham" <jim_graham [...] sympatico.ca> |
Hi
Module::Starter::PBP v0.0.3 breaks on windows standard home directories, of the form C:\Documents and Settings\<user>.
1. in setup, the default template_dir value is derived from $ENV{HOME}. On windows, this can be derived from $ENV{USERPROFILE}
2. in module creation, the t_guts method breaks on template_dirs with spaces in them due to the file glob.
for my $test_file ( map { s{\A .*/t/}{}xms; $_; }
glob "$self->{template_dir}/t/*" ) {
This can be fixed by converting the template_dir on setup to an 8.3 (non-space) directory.
The following diff addresses these 2 issues.
153a153,157
Show quoted text
> #-- win32 update
> if ( ! defined $ENV{HOME} and defined $ENV{USERPROFILE}) {
> $ENV{HOME} = $ENV{USERPROFILE};
> }
>
164a169,173
Show quoted text> if ( $^O =~ m{MSWIN|dos}i ) {
> require Win32;
> $template_dir = Win32::GetShortPathName( $template_dir);
> $template_dir =~ s{\\}{/}g;
> }
Thanks, Jim Graham