diff --git a/composer.json b/composer.json index f2dabac..02df3e4 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "baseline" ], "scripts": { - "build": "tools/box.phar compile --config=scripts/box/config.json", + "build": "php scripts/box/prepare-config.php && tools/box.phar compile --config=scripts/box/config.json", "cs-check": "@cs-fixer-check", "cs-fix": "@cs-fixer-fix", "cs-fixer-check": "vendor/bin/php-cs-fixer fix --dry-run", diff --git a/scripts/box/prepare-config.php b/scripts/box/prepare-config.php new file mode 100644 index 0000000..8889f56 --- /dev/null +++ b/scripts/box/prepare-config.php @@ -0,0 +1,19 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +$configPath = __DIR__ . '/config.json'; +$config = json_decode(file_get_contents($configPath), true, 512, \JSON_THROW_ON_ERROR); + +$config['base-path'] = dirname($configPath, 2); + +file_put_contents($config, json_encode($config, \JSON_THROW_ON_ERROR));