diff --git a/src/Commands/NewGame.php b/src/Commands/NewGame.php
index 9bfef3d..c05be86 100644
--- a/src/Commands/NewGame.php
+++ b/src/Commands/NewGame.php
@@ -212,7 +212,8 @@ private function installDependencies(string $targetDirectory): void
{
// Install dependencies
$this->output->writeln('Installing dependencies...', OutputInterface::VERBOSITY_VERBOSE);
- if (false === `composer install --working-dir=$targetDirectory --ansi`) {
+ $installCommand = "composer install --working-dir=" . escapeshellarg($targetDirectory) . " --ansi";
+ if (false === shell_exec($installCommand)) {
throw new RuntimeException('Unable to install dependencies');
}
}
diff --git a/src/Commands/ViewLog.php b/src/Commands/ViewLog.php
index f4afafe..6b21c07 100644
--- a/src/Commands/ViewLog.php
+++ b/src/Commands/ViewLog.php
@@ -55,10 +55,15 @@ public function execute(InputInterface $input, OutputInterface $output): int
return Command::FAILURE;
}
- if (shell_exec('which multitail')) {
- `multitail $logFilename`;
- } else {
- `tail $logFilename`;
+ $logCommand = "tail ";
+
+ if (shell_exec("which multitail")) {
+ $logCommand = "multitail ";
+ }
+
+ if (false === shell_exec($logCommand . escapeshellarg($logFilename))) {
+ $output->writeln("Failed to open log file $logFilename.");
+ return Command::FAILURE;
}
return Command::SUCCESS;