appDown(); $running = $this->stopTmux(); try { $output = $this->call('nntmux:git'); if ($output === 'Already up-to-date.') { $this->info($output); } else { $status = $this->call('nntmux:composer'); if ($status) { $this->error('Composer failed to update!!'); } $fail = $this->call('nntmux:db'); if ($fail) { $this->error('Db updating failed!!'); } } } catch (\Exception $e) { $this->error($e->getMessage()); } // Install npm packages $this->info('Installing npm packages...'); $process = Process::timeout(360)->run('npm install'); echo $process->output(); echo $process->errorOutput(); $this->info('Npm packages installed successfully!'); // Run npm build $this->info('Building assets...'); $process = Process::timeout(360)->run('npm run build'); echo $process->output(); echo $process->errorOutput(); $this->info('Assets built successfully!'); $cleared = (new Smarty())->setCompileDir(config('ytake-laravel-smarty.compile_path'))->clearCompiledTemplate(); if ($cleared) { $this->output->writeln('The Smarty compiled template cache has been cleaned for you'); } else { $this->output->writeln( 'You should clear your Smarty compiled template cache at: '. config('ytake-laravel-smarty.compile_path').'' ); } if ($maintenance === true) { $this->call('up'); } if ($running === true) { $this->startTmux(); } } private function appDown(): bool { if (App::isDownForMaintenance() === false) { $this->call('down', ['--render' => 'errors::maintenance', '--retry' => 120]); return true; } return false; } private function stopTmux(): bool { if ((new Tmux())->isRunning() === true) { $this->call('tmux-ui:stop', ['--kill' => true]); return true; } return false; } private function startTmux(): void { $this->call('tmux-ui:start'); } }