From 0eab525af545316df02977d6df588e9921df042f Mon Sep 17 00:00:00 2001 From: nicobn Date: Mon, 25 Jun 2007 04:19:23 +0000 Subject: [PATCH] Made bundle.php more intelligent. --- tools/cli/bundle.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/cli/bundle.php b/tools/cli/bundle.php index d5c4c4602..8ff3c650b 100644 --- a/tools/cli/bundle.php +++ b/tools/cli/bundle.php @@ -3,12 +3,24 @@ * Small command line script to bundle Doctrine classes. */ if (count($argv) < 2) { - echo "Usage: bundle.php "; + echo "Usage: bundle.php [Target directory] \n\n". + "Note: If the library directory is ommited, the path will be deducted\n"; exit(1); +} else if (count($argv) == 3) { + $doctrineBaseDir = $argv[2]; +} else { + $doctrineBaseDir = str_replace('tools/cli', 'lib', $_SERVER['PWD'], $Cnt); + + if ($Cnt != 1) { + echo "Can't find library directory, please specify it as an argument\n"; + exit(1); + } } -$doctrineBaseDir = $argv[1]; -$targetDir = $argv[2]; +$targetDir = $argv[1]; + +print "target: $targetDir\n"; +print "base dire: $doctrineBaseDir\n"; set_include_path(get_include_path() . PATH_SEPARATOR . $doctrineBaseDir); @@ -24,4 +36,4 @@ Doctrine_Compiler::compile($targetDir); echo "Bundle complete." . PHP_EOL; exit(0); -?> \ No newline at end of file +?>