14 lines
422 B
PHP
14 lines
422 B
PHP
|
|
<?php
|
|||
|
|
// $command = 'cd /www/wwwroot/bjweb/ && sudo git pull';
|
|||
|
|
$command = 'cd "$(dirname "$0")" && sudo git pull';
|
|||
|
|
|
|||
|
|
$res = shell_exec($command);
|
|||
|
|
|
|||
|
|
if (strpos($res,'Updating') !== false){
|
|||
|
|
$command1 = 'sudo git stash && sudo git pull && sudo git stash pop';
|
|||
|
|
$res1 = shell_exec($command1);
|
|||
|
|
echo '执行结果' . $res1;
|
|||
|
|
echo 'git pull执行结果:' . $res;
|
|||
|
|
} else{
|
|||
|
|
echo 'git pull执行结果:' . $res;
|
|||
|
|
}
|