WDictionaries/Public/git_update.php

16 lines
398 B
PHP
Executable File

<?php
header("content-type: text/plain");
$fetch = trim(shell_exec("git fetch 2>&1"));
if(!preg_match('/(From|Desde) https:\/\//', $fetch)){
echo "There are not any updates.";
// echo "There is no update.";
exit(0);
};
$pull = shell_exec("git pull 2>&1");
echo $fetch . "\n\n" . $pull . "\n\nIt is already updated successfully.";