You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
information-system/please_dont_delete_this_fil...

23 lines
718 B
PHP

<?php
header("Cache-Control: no-cache");
$branch = 'develop';
if(array_key_exists('branch',$_REQUEST)){
if(in_array($_REQUEST['branch'], array('master', 'develop'))){
$branch = $_REQUEST['branch'];
}
}
$self_path=str_replace('\\','/',dirname(__FILE__));
//exec('e:\usr\Git\bin\sh.exe -c "export HOME=/e/usr;cd '.$self_path.';git pull" 2>&1', $out, $status);
//echo '"c:\Program Files\Git\bin\sh.exe" -c "export HOME=/c/Users/cht58;git checkout master -f;cd '.$self_path.';git pull" 2>&1';
exec('e:\usr\Git\bin\sh.exe -c "export HOME=/e/usr;git pull"', $out, $status);
if (0 === $status) {
print("Done");
} else {
header("Status: 500");
echo "Command failed status: $status <br/>";
print_r($out);
}