Skip to content

Commit

Permalink
Merge pull request #15 from LibreSign/feature/validate-root-dir
Browse files Browse the repository at this point in the history
Validate root dir
  • Loading branch information
vitormattos authored May 27, 2022
2 parents 188f57e + ca16429 commit 8148a16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use Exception;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down Expand Up @@ -108,6 +109,9 @@ private function getRootDir(array $config): string
$rootDir = $config['rootDir'];
}
$rootDir = realpath($rootDir);
if (!empty($rootDir) && !is_dir($rootDir)) {
throw new Exception('Invalid root dir [' . $rootDir . '], define BEHAT_ROOT_DIR environment or rootDir config value with valid path');
}
return $rootDir;
}

Expand Down

0 comments on commit 8148a16

Please sign in to comment.