Skip to content

Commit 74c83bb

Browse files
committed
fix: fa data prerequisite check
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 78c12a8 commit 74c83bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setup.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ function plugin_formcreator_check_prerequisites() {
8989
$prerequisitesSuccess = false;
9090
}
9191

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

0 commit comments

Comments
 (0)