add scripts to manage git post hooks

This commit is contained in:
eddiemonge 2011-04-13 16:15:00 -07:00
parent 4f7c08140d
commit 2e9e8f203a
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<?php
$file = fopen('gitstatus.log','wb');
fwrite($file, 'NewCommit');
close($file);
fclose($file);

View file

@ -1,9 +1,9 @@
<?php
$file = fopen('gitstatus.log', 'r+b');
if ( fread($file) === 'NewCommit' )
$filename = 'gitstatus.log';
$file = fopen($filename, 'r+b');
if ( fread($file, filesize($filename)) === 'NewCommit' )
{
ftruncate($file);
exec('git pull --quiet && make NIGHTLY_OUTPUT=latest nightly >> /dev/null 2>&1');
ftruncate($file, 0);
exec('git pull --quiet && make NIGHTLY_OUTPUT=latest nightly >> /dev/null 2>&1');
}