Skip to content

Commit

Permalink
fix: fa data prerequisite check
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Oct 15, 2019
1 parent 78c12a8 commit 74c83bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ function plugin_formcreator_check_prerequisites() {
$prerequisitesSuccess = false;
}

$fi = new FilesystemIterator(__DIR__ . '/../', FilesystemIterator::SKIP_DOTS);
if (iterator_count($fi) < 1) {
$fi = new FilesystemIterator(__DIR__ . '/data/', FilesystemIterator::SKIP_DOTS);
if (iterator_count($fi) < 2) {
// There is index.html at least in the directory, then 2 files must estxist
// to validate the existence of data files
echo "You must run vendor/bin/robo build:fa-data in the directory of the plugin";
$prerequisitesSuccess = false;
}
Expand Down

0 comments on commit 74c83bb

Please sign in to comment.