From beef6187b436207c460989782b01aab683ebb0ec Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Mon, 27 Oct 2014 11:37:09 +0100 Subject: [PATCH] New dependancie : bash or shell supporting && operator --- README.md | 6 ++++++ ajax.php | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 63a9306..72f0c15 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ What I need to run it ? ---------- Nothing more than a web server with PHP 5 installed. +The git clients *MUST HAVE bash* or shell like him supporting && operator + +Shells tested and working : +- Bash +- lshell +- zsh Why ? ---------- diff --git a/ajax.php b/ajax.php index 7f4f06a..7cfa214 100644 --- a/ajax.php +++ b/ajax.php @@ -39,26 +39,26 @@ if (!empty($_POST['action'])) { if ($session->isConnected()) { if ($_POST['action'] == 'status') { - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $gitstatus . "'")); + echo ansi2html($session->exec('cd ' . $config['path'] . ' && ' . $gitstatus)); exit; } else if (strpos($_POST['action'], 'push') !== false) { if (strpos($_POST['action'], 'force') !== false) { - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git push && ' . $gitstatus . "'")); + echo ansi2html($session->exec('cd ' . $config['path'] . ' && git push && ' . $gitstatus)); if (!empty($config['after_push'])) { - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $config['after_push'] . "'")); + echo ansi2html($session->exec('cd ' . $config['path'] . ' && ' . $config['after_push'])); } } else { $message = empty($_POST['message']) ? 'FTP' : str_replace(array('"', "'"), ' ', stripslashes($_POST['message'])); - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push && ' . $gitstatus . "'")); + echo ansi2html($session->exec('cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push && ' . $gitstatus)); if (!empty($config['after_push'])) { echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $config['after_push'] . "'")); } } exit; } else if ($_POST['action'] == 'pull') { - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git pull && ' . $gitstatus . "'")); + echo ansi2html($session->exec('cd ' . $config['path'] . ' && git pull && ' . $gitstatus)); if (!empty($config['after_pull'])) { - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $config['after_pull'] . "'")); + echo ansi2html($session->exec('cd ' . $config['path'] . ' && ' . $config['after_pull'])); } exit; } else {