Keep running process with delays between of 2 secs

This commit is contained in:
Matt Pass
2019-10-06 14:06:31 +01:00
committed by GitHub
parent 81ecf6e0b5
commit fc0a9bb6e8

View File

@@ -1,9 +1,12 @@
<?php
// include("headers.php");
// include("settings.php");
$gitData = shell_exec("{ git diff --name-only --staged ; git ls-files --other --modified --exclude-standard ;} | sort | uniq");
$diffLines = explode("\n", $gitData);
$output = ["paths" => array_filter($diffLines)];
// Store the serialized array in PHP comment block for pick up
file_put_contents($docRoot.$ICEcoderDir."/data/git-diff.php", "<?php\n/\n\n".serialize($output)."\n\n/\n?".">");
while(true) {
$gitData = shell_exec("cd .. && { git diff --name-only --staged ; git ls-files --other --modified --exclude-standard ;} | sort | uniq");
$diffLines = explode("\n", $gitData);
$output = ["paths" => array_filter($diffLines)];
// Store the serialized array in PHP comment block for pick up
file_put_contents(dirname(__FILE__)."/../data/git-diff.php", "<?php\n/*\n\n".serialize($output)."\n\n*/\n?".">");
sleep(2);
}
?>