mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-21 22:32:41 +01:00
Improve symbol generation scripts
Summary: Currently the symbol generation scripts fail if passed a list containing no files because `explode("\n", $input)` returns `array("")` rather than `array()`. This means that a generic Harbormaster Build Plan with a step which executes `find . -type f -name '*.php' | ./scripts/generate_php_symbols.php` won't work because it fails in repositories that don't contain any PHP code. Test Plan: Ran `echo | generate_php_symbols` and saw no output instead of an exception. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D19588
This commit is contained in:
parent
cc1def6cea
commit
ba25586016
2 changed files with 8 additions and 0 deletions
|
@ -39,6 +39,10 @@ $data = array();
|
|||
$futures = array();
|
||||
|
||||
foreach (explode("\n", trim($input)) as $file) {
|
||||
if (!strlen($file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file = Filesystem::readablePath($file);
|
||||
$futures[$file] = ctags_get_parser_future($file);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,10 @@ $data = array();
|
|||
$futures = array();
|
||||
|
||||
foreach (explode("\n", trim($input)) as $file) {
|
||||
if (!strlen($file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file = Filesystem::readablePath($file);
|
||||
$data[$file] = Filesystem::readFile($file);
|
||||
$futures[$file] = PhutilXHPASTBinary::getParserFuture($data[$file]);
|
||||
|
|
Loading…
Reference in a new issue