From: Christian Weiske Date: Mon, 21 Dec 2015 05:58:56 +0000 (+0100) Subject: Load version number from file X-Git-Tag: v0.1.0^0 X-Git-Url: https://git.cweiske.de/php-sqllint.git/commitdiff_plain/ba5d5e864584bbad0a486f2f86f62ef340aeeade?ds=sidebyside Load version number from file --- diff --git a/.gitignore b/.gitignore index c1e6936..2458a03 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /README.html /dist /bin/phar-php-sqllint.php +VERSION diff --git a/README.rst b/README.rst index e02ff6b..d4ae83c 100644 --- a/README.rst +++ b/README.rst @@ -96,8 +96,7 @@ Building Preparation =========== -- Adjust version number in ``src/phpsqllint/Cli.php`` -- Adjust version number in ``build.xml`` +1. Write new version number into ``VERSION`` Create the release diff --git a/build.xml b/build.xml index 9585aa1..4d1b07e 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,13 @@ - + + + + + + + @@ -12,6 +18,7 @@ + diff --git a/src/phpsqllint/Cli.php b/src/phpsqllint/Cli.php index 1448a53..4edcf66 100644 --- a/src/phpsqllint/Cli.php +++ b/src/phpsqllint/Cli.php @@ -163,9 +163,14 @@ class Cli { $parser = new \Console_CommandLine(); $parser->description = 'php-sqllint'; - $parser->version = '0.0.2'; + $parser->version = 'dev'; $parser->avoid_reading_stdin = true; + $versionFile = __DIR__ . '/../../VERSION'; + if (file_exists($versionFile)) { + $parser->version = trim(file_get_contents($versionFile)); + } + $parser->addOption( 'format', array(