diff options
Diffstat (limited to 'scripts/dev/tidy.php')
-rw-r--r-- | scripts/dev/tidy.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/dev/tidy.php b/scripts/dev/tidy.php index 7ec9f7902d..967f83bcb3 100644 --- a/scripts/dev/tidy.php +++ b/scripts/dev/tidy.php @@ -4,9 +4,18 @@ set_error_handler(function($_, $msg) { throw new Exception($msg); }); -$rootDir = __DIR__ . '/../..'; +if ($argc > 1) { + $dir = $argv[1]; +} else { + $dir = __DIR__ . '/../..'; +} +if (!is_dir($dir)) { + echo "Directory $dir does not exist.\n"; + exit(1); +} + $it = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($rootDir), + new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY ); |