Skip to content

Commit

Permalink
FCM::Util: version: should not require git
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrmshin committed Nov 8, 2013
1 parent e5f7736 commit 8bc562c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/FCM/Util.pm
Expand Up @@ -469,10 +469,18 @@ sub _util_of_func {
sub _version { sub _version {
my ($attrib_ref) = @_; my ($attrib_ref) = @_;
# Try "git describe" # Try "git describe"
my $value_hash_ref = $ACTION_OF{shell_simple}->( my $value_hash_ref = eval {
$attrib_ref, $ACTION_OF{shell_simple}->(
['git', "--git-dir=$FindBin::Bin/../.git", 'describe'], $attrib_ref,
); ['git', "--git-dir=$FindBin::Bin/../.git", 'describe'],
);
};
if (my $e = $@) {
if (!$E->caught($e)) {
die($e);
}
$@ = undef;
}
if ($value_hash_ref->{o} && !$value_hash_ref->{rc}) { if ($value_hash_ref->{o} && !$value_hash_ref->{rc}) {
chomp($value_hash_ref->{o}); chomp($value_hash_ref->{o});
return "FCM " . $value_hash_ref->{o}; return "FCM " . $value_hash_ref->{o};
Expand Down

0 comments on commit 8bc562c

Please sign in to comment.