Skip to content

Instantly share code, notes, and snippets.

@sotarok
Created January 31, 2009 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sotarok/55563 to your computer and use it in GitHub Desktop.
Save sotarok/55563 to your computer and use it in GitHub Desktop.
github-pull-queue-observe
<?php
/**
* github-pull-queue-observe.php
*
* @description file queue
*/
define("__DIR__", realpath(dirname(__FILE__)));
echo __DIR__;
while(1) {
foreach (glob("./queue/*") as $file) {
$file_path = realpath($file);
$file_name = basename($file);
chdir(__DIR__ . "/$file_name");
system("/usr/bin/git pull");
chdir(__DIR__);
unlink($file_path);
}
sleep(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment