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/]
);
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 });
}
$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