From 7eddb2b5f05ab22aef2c4c04e365cf69bfc001d2 Mon Sep 17 00:00:00 2001 From: Carneiro Date: Wed, 22 Jan 2025 16:38:44 -0300 Subject: [PATCH] Update php/upload.php --- php/upload.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/php/upload.php b/php/upload.php index c4a20bc..c1e955a 100755 --- a/php/upload.php +++ b/php/upload.php @@ -76,10 +76,14 @@ } function push_to_git() { - $git_cmd = 'git --git-dir=/var/www/src/aliceclass'; - shell_exec($git_cmd . ' add /var/www/src/aliceclass/_data/aulas.json'); - shell_exec($git_cmd . ' commit -m "update data"'); - shell_exec($git_cmd . ' push'); + $git_cmd = 'cd /var/www/src/aliceclass; git '; + + shell_exec($git_cmd . ' config user.name www-data 2>&1'); + shell_exec($git_cmd . ' config user.email www-data@noreply.alice 2>&1'); + + shell_exec($git_cmd . ' add /var/www/src/aliceclass/_data/aulas.json 2>&1'); + shell_exec($git_cmd . ' commit -m "update data" 2>&1'); + shell_exec($git_cmd . ' push 2>&1'); } $username = $_SERVER['PHP_AUTH_USER'];