Commit af643ec2 authored by Jan Kuchař's avatar Jan Kuchař
Browse files

Update checkThatScaffoldedFilesWasNotOverriden.php

parent d767ea57
Pipeline #23687 passed with stages
in 1 minute and 14 seconds
<?php
$isGitRepoClean = static fn(): bool => shell_exec('git status --porcelain') === NULL;
$stash = static fn() => shell_exec('git stash');
$unstash = static fn() => shell_exec('git stash pop');
$stash();
shell_exec('composer run scaffold');
$failed = !$isGitRepoClean();
if ($failed) {
echo 'You have made following changes in generated files,'
. 'consider excluding them from .definition.php file '
. 'or reconfiguring class definition:';
echo shell_exec('git diff --color');
} else {
echo "Nice! It looks like all generated files are up-to-date!\n";
}
// clean the mess
shell_exec('git reset --hard HEAD');
$unstash();
exit($failed ? 1 : 0);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment