mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-20 23:41:57 +02:00
build-prefied-rector - change destination to own directory
This commit is contained in:
parent
43101adc08
commit
9058c60a6e
@ -1,13 +1,16 @@
|
||||
#!/usr/bin/env php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
use Nette\Utils\FileSystem;
|
||||
use Nette\Utils\Json;
|
||||
|
||||
require_once __DIR__ . '/../bootstrap.php';
|
||||
|
||||
$buildDestination = getenv('BUILD_DESTINATION');
|
||||
|
||||
// load
|
||||
$composerJsonPath = __DIR__ . '/../build/composer.json';
|
||||
$composerContent = Json::decode(file_get_contents($composerJsonPath), Json::FORCE_ARRAY);
|
||||
$composerJsonPath = $buildDestination . '/composer.json';
|
||||
$composerContent = Json::decode(FileSystem::read($composerJsonPath), Json::FORCE_ARRAY);
|
||||
|
||||
// remove unused sections
|
||||
unset($composerContent['require-dev'], $composerContent['scripts'], $composerContent['config'], $composerContent['autoload-dev'], $composerContent['authors']);
|
||||
@ -21,4 +24,4 @@ $composerContent['require'] = [
|
||||
];
|
||||
|
||||
// save
|
||||
file_put_contents($composerJsonPath, Json::encode($composerContent, Json::PRETTY));
|
||||
FileSystem::write($composerJsonPath, Json::encode($composerContent, Json::PRETTY));
|
||||
|
@ -67,7 +67,7 @@ chmod +x $BUILD_DESTINATION/bin/rector
|
||||
rm -rf /tmp/_prefixed_rector_cache
|
||||
|
||||
# build composer.json
|
||||
bin/rector-prefixed/build-composer-json.php
|
||||
BUILD_DESTINATION=$BUILD_DESTINATION bin/rector-prefixed/build-composer-json.php
|
||||
|
||||
# run it to test it
|
||||
build/bin/rector
|
||||
|
Loading…
x
Reference in New Issue
Block a user