Permalink
Browse files

allow calling hooks directly as .../hook.php path/to/file

  • Loading branch information...
1 parent c195b61 commit 50cd86cb3c92bec3523433fa5b4ca8b9d67b4131 @AD7six committed Nov 16, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 utils.php
View
@@ -43,6 +43,22 @@ function config($branch = null) {
*
*/
function files() {
+ if (!empty($_SERVER['argv'][1])) {
+ $files = $_SERVER['argv'];
+ array_shift($files);
+
+ $break = false;
+ foreach($files as $file) {
+ if (!is_file($file)) {
+ $break = true;
+ break;
+ }
+ }
+
+ if (!$break) {
+ return $files;
+ }
+ }
if (!trim(`echo \$GIT_DIR`) && !trim(`echo \$GIT_AUTHOR_NAME`)) {
$where = '.';
$locations = func_get_args();

0 comments on commit 50cd86c

Please sign in to comment.