diff --git a/README.md b/README.md index b290b4f..4156a40 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,25 @@ To install this package with Nix, clone the Git repository and run: $ nix-env -f release.nix -iA package.x86_64-linux ``` +Building a development version +============================== +A development version can be deployed by checking out the Git repository and +running: + +```bash +$ nix-env -f release.nix -iA package.x86_64-linux +``` + +The above command installs the development `composer2nix` executable into the +Nix profile of the user. + +Alternatively, you can use `composer` directly to install the project +dependencies: + +```bash +$ composer install +``` + Usage ===== You need a project providing a `composer.json` and (if applicable) a diff --git a/bin/composer2nix b/bin/composer2nix index 99c2fdf..d878609 100755 --- a/bin/composer2nix +++ b/bin/composer2nix @@ -8,13 +8,16 @@ $autoloadLocations = [ __DIR__ . '/../../../autoload.php', ]; $loaded = false; -foreach ($autoloadLocations as $autoload) { +foreach ($autoloadLocations as $autoload) +{ if (is_file($autoload)) { require_once($autoload); $loaded = true; } } -if (!$loaded) { + +if (!$loaded) +{ fwrite(STDERR, 'You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL .