neoxygen/neo4j-toolkit — pull request #1 by jeremykendall (2014-11-05 03:04:19+00:00)
Title: Adds a Composer script to create config dir after install

I got the following error when trying to run `./bin/neo db:list`:

```
jeremykendall at orgrimmar in ~/dev/neo4j-toolkit on master
$ ./bin/neo db:list
-----------------------
NeoToolkit Version 0.1.0-dev
This is a development version, do not use in production environment
-----------------------
PHP Warning: file_put_contents(/Users/jeremykendall/.neotoolkit/config): failed to open stream: No such file or directory in /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php on line 60
PHP Stack trace:
PHP 1. {main}() /Users/jeremykendall/dev/neo4j-toolkit/bin/neo:0
PHP 2. Symfony\Component\Console\Application->run() /Users/jeremykendall/dev/neo4j-toolkit/bin/neo:22
PHP 3. Symfony\Component\Console\Application->doRun() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP 4. Symfony\Component\Console\Application->doRunCommand() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP 5. Symfony\Component\Console\Command\Command->run() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP 6. Neoxygen\NeoToolkit\Terminal\ListCommand->execute() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
PHP 7. Neoxygen\NeoToolkit\Factory::getConfig() /Users/jeremykendall/dev/neo4j-toolkit/src/Terminal/ListCommand.php:44
PHP 8. Neoxygen\NeoToolkit\Factory::createConfigFile() /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php:47
PHP 9. Neoxygen\NeoToolkit\Factory::setConfig() /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php:70
PHP 10. file_put_contents() /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php:60

Warning: file_put_contents(/Users/jeremykendall/.neotoolkit/config): failed to open stream: No such file or directory in /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php on line 60

Call Stack:
0.0002 239968 1. {main}() /Users/jeremykendall/dev/neo4j-toolkit/bin/neo:0
0.0094 1695064 2. Symfony\Component\Console\Application->run() /Users/jeremykendall/dev/neo4j-toolkit/bin/neo:22
0.0117 2031216 3. Symfony\Component\Console\Application->doRun() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Application.php:126
0.0118 2032136 4. Symfony\Component\Console\Application->doRunCommand() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Application.php:195
0.0118 2032608 5. Symfony\Component\Console\Command\Command->run() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Application.php:874
0.0120 2036272 6. Neoxygen\NeoToolkit\Terminal\ListCommand->execute() /Users/jeremykendall/dev/neo4j-toolkit/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
0.0125 2053888 7. Neoxygen\NeoToolkit\Factory::getConfig() /Users/jeremykendall/dev/neo4j-toolkit/src/Terminal/ListCommand.php:44
0.0125 2054112 8. Neoxygen\NeoToolkit\Factory::createConfigFile() /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php:47
0.0125 2054608 9. Neoxygen\NeoToolkit\Factory::setConfig() /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php:70
0.0136 2239528 10. file_put_contents() /Users/jeremykendall/dev/neo4j-toolkit/src/Factory.php:60

No Neo4j instances registered
```

This PR adds a [Composer script](https://getcomposer.org/doc/articles/scripts.md) that runs during the `post-install-cmd` event to create the missing config dir so that `file_put_contents` won't blow up.