revert to exec() to composer install

This commit is contained in:
David Bomba 2020-12-17 10:23:54 +11:00
parent 9b259ed3d0
commit 831d1e0816
2 changed files with 6 additions and 16 deletions

View File

@ -15,8 +15,6 @@ use App\Jobs\Util\VersionCheck;
use Composer\Console\Application;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
class PostUpdate extends Command
{
@ -55,22 +53,10 @@ class PostUpdate extends Command
info("finished migrating");
try {
putenv('COMPOSER_HOME=' . __DIR__ . '/vendor/bin/composer');
$input = new ArrayInput(['command' => 'install', '--no-dev' => 'true']);
$application = new Application();
$application->setAutoExit(false);
$output = new BufferedOutput();
$application->run($input, $output);
}catch(\Exception $e) {
info("i wasn't able to compser install");
info(print_r($e->getMessage(),1));
}
exec('vendor/bin/composer install --no-dev:');
info("finished running composer install ");
info(print_r($output->fetch(), 1));
try {
Artisan::call('optimize');

View File

@ -75,7 +75,11 @@ class SelfUpdateController extends BaseController
}
info('Are there any changes to pull? '.$repo->hasChanges());
Artisan::call('ninja:post-update');
dispatch(function (){
Artisan::call('ninja:post-update');
});
return response()->json(['message' => ''], 200);
}