diff options
-rw-r--r-- | Build.PL | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -4,7 +4,7 @@ use strict; use warnings; use Module::Build; -my $build = Module::Build->new( +my %opts = ( build_requires => { 'Test::More' => 0, 'Test::Compile' => 0, @@ -21,4 +21,11 @@ my $build = Module::Build->new( 'WWW::Mechanize' => 0, }, ); + +if (-d '.git' and qx{which git} =~ qr{/git$}) { + $opts{'dist_version'} = qx{git describe}; + chomp $opts{'dist_version'}; +} + +my $build = Module::Build->new(%opts); $build->create_build_script; |