summaryrefslogtreecommitdiff
path: root/Build.PL
diff options
context:
space:
mode:
Diffstat (limited to 'Build.PL')
-rw-r--r--Build.PL9
1 files changed, 8 insertions, 1 deletions
diff --git a/Build.PL b/Build.PL
index 2c4cdba..3fa2b19 100644
--- a/Build.PL
+++ b/Build.PL
@@ -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;