App-GitHooks-Plugin-ForceRegularUpdate
view release on metacpan or search on metacpan
lib/App/GitHooks/Plugin/ForceRegularUpdate.pm view on Meta::CPAN
);
return $PLUGIN_RETURN_FAILED;
}
# Retrieve the value of the file and check whether it's within the bounds
# allowed.
my $last_update = File::Slurp::read_file( $update_file );
chomp( $last_update );
if ( !defined( $last_update ) # Invalid format.
|| ( $last_update !~ /^\d+$/ ) # Invalid format.
|| ( $last_update < time() - $max_update_age ) # Not updated in a long time.
|| ( $last_update > time() + 10 ) # Nice try setting the timestamp in the future to not have to update.
)
{
print $app->wrap(
$app->color(
'red',
"$failure_character It appears that you haven't performed $description on this machine for a long time. Please do that and try to commit again.\n"
),
"",
);
( run in 0.322 second using v1.01-cache-2.11-cpan-05444aca049 )