From cb46dc31f5ec739024ccdd86a1710da87a9ef236 Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Sun, 16 Nov 2008 08:56:34 +0200 Subject: [PATCH] die with an error message if exec() fails. In case passthru() fails, we output nothing; the download ends up being zero-sized. --- inc/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 7a49b68..b64004b 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -408,7 +408,7 @@ function run_git($project, $command) $output = array(); $cmd = "GIT_DIR=". $conf['projects'][$project]['repo'] ." ". $conf['git'] ." $command"; - exec($cmd, $output); + exec($cmd, $output) or die('FATAL: exec() for git failed, is the path properly configured?'); return $output; } @@ -422,7 +422,7 @@ function run_git_passthru($project, $command) $cmd = "GIT_DIR=". $conf['projects'][$project]['repo'] ." ". $conf['git'] ." $command"; $result = 0; - passthru($cmd, $result); + passthru($cmd, $result) or die(); return $result; } -- 2.11.4.GIT