Skip to content

Commit fce6e4e

Browse files
committed
fix(util.executable): log if only writable
1 parent b9d8c09 commit fce6e4e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Util/Executable.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@ protected function runCommand($command)
9393

9494
$proc->setOptions($this->workDir)->execute();
9595

96-
$data = $proc->getOutput() . \PHP_EOL . $proc->getErrorOutput();
97-
(new Path)->writeFile($this->logFile, $data, \FILE_APPEND);
96+
if ($this->logFile && \is_writable(\dirname($this->logFile))) {
97+
$data = $proc->getOutput() . \PHP_EOL . $proc->getErrorOutput();
98+
99+
(new Path)->writeFile($this->logFile, $data, \FILE_APPEND);
100+
}
101+
98102
$this->isSuccessful = 0 === $proc->getExitCode();
99103

100104
return $proc->getOutput();

0 commit comments

Comments
 (0)