From c75cf6f1eb0976301f0d288592317e102f60a06a Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Mon, 29 Apr 2024 12:53:18 +0300 Subject: [PATCH] Update Terminal.php --- web/Modules/Terminal/Filament/Pages/Terminal.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/Modules/Terminal/Filament/Pages/Terminal.php b/web/Modules/Terminal/Filament/Pages/Terminal.php index 4687a4c..5b9eda6 100644 --- a/web/Modules/Terminal/Filament/Pages/Terminal.php +++ b/web/Modules/Terminal/Filament/Pages/Terminal.php @@ -59,7 +59,10 @@ class Terminal extends Page } } if ($runNewTerminal) { - // $exec = shell_exec('node /usr/local/phyre/web/Modules/Terminal/nodejs/terminal/server.js >> /usr/local/phyre/web/storage/logs/terminal/server-terminal.log &'); + if (!is_dir('/usr/local/phyre/web/Modules/Terminal/nodejs/terminal/node_modules')) { + $exec = shell_exec('cd /usr/local/phyre/web/Modules/Terminal/nodejs/terminal && npm install'); + } + $exec = shell_exec('node /usr/local/phyre/web/Modules/Terminal/nodejs/terminal/server.js >> /usr/local/phyre/web/storage/logs/terminal/server-terminal.log &'); } return [