Check if compile.php target directories exist, exit if not

If it's not run from the correct directory, a spew of warnings appear

Add done message and also one if not running on the CLI

Change-Id: Iec508acf4216aba7d084bb57156b87bfb117ff4a
This commit is contained in:
Reedy
2013-10-29 13:29:40 +00:00
parent 0473d83937
commit 33ca6d47ee

View File

@@ -1,7 +1,11 @@
<?php <?php
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) { if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
exit(); exit( "compile.php should be run from the command line\n" );
}
if ( !is_dir( '../fonts/' ) ) {
exit( "compile.php should be run from the data/fontrepo/scripts directory\n" );
} }
$list = array(); $list = array();
@@ -97,3 +101,5 @@ $js = <<<JAVASCRIPT
JAVASCRIPT; JAVASCRIPT;
file_put_contents( '../../../resources/js/ext.uls.webfonts.repository.js', $js ); file_put_contents( '../../../resources/js/ext.uls.webfonts.repository.js', $js );
echo "Done.\n";