diff --git a/include/functions.php b/include/functions.php index 0fc112a..7a534aa 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,144 +1,141 @@ stdout); } /** * Execute a shell command and get the first output line. * @param string $command e.g. 'git' * @param string $args Command line arguments not-escaped (we will escape them) e.g. ['status'] * @return string First line of output from git status. */ function shell_line(string $command, array $args) { $lines = shell_lines($command, $args); foreach ($lines as $line) { return trim($line); } return null; } /** * Show a stupidly formatted log line. * @param string $msg */ function print_log($level, $msg) { printf("[%s][%s] %s\n", $level, date('Y-m-d H:i:s'), $msg ); } /** * Show a stupidly formatted log INFO line. * @param string $msg */ function print_log_info($msg) { print_log('INFO', $msg); } /** * Show a stupidly formatted log ERROR line. * @param string $msg */ function print_log_error($msg) { print_log('ERROR', $msg); }