Add check for file existence in SplitSource.php.

GitOrigin-RevId: a8cc5e828a4dbba734a928f9bf11870a42914d53
This commit is contained in:
levlam 2018-11-02 18:30:00 +03:00
parent 32fc43655a
commit 4611f863a8
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,11 @@ function split_file($file, $chunks, $undo) {
file_put_contents($cmake_file, $cmake);
}
if (!file_exists($cpp_name)) {
echo "ERROR: skip unexisting file $cpp_name".PHP_EOL;
return;
}
$lines = file($cpp_name);
$depth = 0;
$target_depth = 1 + $is_generated;