Dist-Zilla-PluginBundle-DROLSKY

 view release on metacpan or  search on metacpan

lib/Dist/Zilla/Plugin/DROLSKY/Role/MaybeFileWriter.pm  view on Meta::CPAN

    my $content       = shift;
    my $is_executable = shift;

    my $file = path($path);

    return if $file->exists;

    ## no critic (ValuesAndExpressions::ProhibitLeadingZeros )
    $file->parent->mkpath( 0, 0755 );
    $file->spew_utf8($content);
    $file->chmod(0755) if $is_executable;

    return;
}

1;

# ABSTRACT: Knows how to maybe write files

__END__



( run in 0.646 second using v1.01-cache-2.11-cpan-8d75d55dd25 )