Add build instructions, fix some formatting inconsistencies

This commit is contained in:
Sander van der Burg 2020-03-16 22:41:17 +01:00
parent 5d86498b1b
commit 5ffce63100
2 changed files with 24 additions and 2 deletions

View file

@ -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 $ 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 Usage
===== =====
You need a project providing a `composer.json` and (if applicable) a You need a project providing a `composer.json` and (if applicable) a

View file

@ -8,13 +8,16 @@ $autoloadLocations = [
__DIR__ . '/../../../autoload.php', __DIR__ . '/../../../autoload.php',
]; ];
$loaded = false; $loaded = false;
foreach ($autoloadLocations as $autoload) { foreach ($autoloadLocations as $autoload)
{
if (is_file($autoload)) { if (is_file($autoload)) {
require_once($autoload); require_once($autoload);
$loaded = true; $loaded = true;
} }
} }
if (!$loaded) {
if (!$loaded)
{
fwrite(STDERR, fwrite(STDERR,
'You must set up the project dependencies, run the following commands:' . PHP_EOL . 'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL .