Skip to content

Instantly share code, notes, and snippets.

@2shortplanks
Created March 15, 2016 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2shortplanks/a788b6539b1bfd033e60 to your computer and use it in GitHub Desktop.
Save 2shortplanks/a788b6539b1bfd033e60 to your computer and use it in GitHub Desktop.
Script I use to write my dist.ini
#!/opt/markperl/bin/perl
use strict;
use warnings;
use Mojo::Template;
use Path::Class qw(file dir);
use Cwd qw(cwd);
my $dist_name = dir(cwd)->dir_list(-1);
my @bits = split /-/, $dist_name;
unshift @bits, 'lib';
pop @bits;
dir(@bits)->mkpath;
my $template = <<'EOF';
% my $dist_name = shift;
name = <%= $dist_name %>
author = Mark Fowler <mark@twoshortplanks.com>
copyright_holder = Mark Fowler
[@MAXMIND]
dist = <%= $dist_name %>
-remove = MAXMIND::Contributors
-remove = UploadToCPAN
%= join '', map { "stopwords = $_\n" } split /-/, $dist_name;
[UploadToCPAN]
EOF
print { file('dist.ini')->openw }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment