X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=maint%2Fgen_sqlite_schema_files;h=0ac70ec2b69e40e7fc4c5e49c44f8220c425c793;hb=e48635f7178f8527ec3cc230f1cf869e8876dc39;hp=a3793d33e7ff0088221130abc5b084d7e11d76ca;hpb=aff5e9c14f7ad7453a4a2a7d04dc4e85fa0d661c;p=dbsrgits%2FDBIx-Class.git diff --git a/maint/gen_sqlite_schema_files b/maint/gen_sqlite_schema_files index a3793d3..0ac70ec 100755 --- a/maint/gen_sqlite_schema_files +++ b/maint/gen_sqlite_schema_files @@ -4,8 +4,8 @@ use strict; use warnings; use Module::Runtime 'use_module'; +use DBIx::Class::_Util qw(mkdir_p parent_dir); use SQL::Translator; -use Path::Class 'file'; use Getopt::Long; my $getopt = Getopt::Long::Parser->new( config => [qw/gnu_getopt bundling_override no_ignore_case/] @@ -34,7 +34,7 @@ my $schema = use_module( $args->{'schema-class'}[0] )->connect( ); if ($args->{'deploy-to'}) { - file($args->{'deploy-to'}[0])->dir->mkpath; + mkdir_p parent_dir $args->{'deploy-to'}[0]; $schema->deploy({ add_drop_table => 1 }); } @@ -43,10 +43,9 @@ if ($args->{'ddl-out'}[0] eq '-') { $ddl_fh = *STDOUT; } else { - my $fn = file($args->{'ddl-out'}[0]); - $fn->dir->mkpath; - open $ddl_fh, '>', $fn - or die "Unable to open $fn: $!\n"; + mkdir_p parent_dir $args->{'ddl-out'}[0]; + open $ddl_fh, '>', $args->{'ddl-out'}[0] + or die "Unable to open $args->{'ddl-out'}[0]: $!\n"; } binmode $ddl_fh; # avoid win32 \n crapfest