dzil bootstrap - There is a solution!

I've been reading Zbigniew Lukasiak's blog post about installing Dist::Zilla plugins and Nigel Metheringham's blog post about his thoughts on Dist::Zilla and I have to completely agree.

Dist::Zilla produces a flexibility like no other with its completely insane everything-is-a-plugin approach. Anyone can write almost any type of plugin that hooks up easily to almost every part of the magic that Dist::Zilla does for you. It really is magnificent.

However, that flexibility comes with an added difficulty. There are a lot of plugins out there and when you want to simply build a dist (`dzil build`), it will load any plugin mentioned in the configuration. Since those are loaded by Moose itself, it means any failure to do that (such as with modules that aren't installed) will result in a big stracktrace. You have to scroll to the top of the trace, see what's missing from the failure-to-load message, install that and try again. Whoops, another one is missing...

How about this then...

Given the file dist.ini:

name    = Dist-Zilla-App-Command-Bootstrap
author  = Sawyer X 
license = Perl_5
copyright_holder = Sawyer X
copyright_year   = 2010

[@Basic]
[Space]
[AI]
[AutoPrereq]
[PodWacker]

You can now run this:

$ dzil bootstrap
You're missing Dist::Zilla::Plugin::Space
You're missing Dist::Zilla::Plugin::AI
You're missing Dist::Zilla::Plugin::PodWacker

So it's not done yet, true, but it's already good enough to feed cpan or cpanm:


# s/^You're missing //;
$ dzil bootstrap | cpanm

It might be smarter to integrate it with the install command of dzil but I don't like how the default client is cpan and it takes you a lot of chars to make it use cpanm instead. We'll see.

Good night!

4 Comments

I wrote that as dzil authordeps a couple of weeks ago. It's part of the Dist::Zilla release that hit CPAN today.

Why would you want to add to it? It already does exactly what you want, except for not requiring you to s/^You're missing //; before passing its output to cpanm :-)

Leave a comment

About Sawyer X

user-pic Gots to do the bloggingz