Skip to content

Commit

Permalink
checks whether temp directory is absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 5, 2023
1 parent 9ac9cd8 commit 6ce2045
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/RobotLoader/RobotLoader.php
Expand Up @@ -397,6 +397,9 @@ public function setAutoRefresh(bool $on = true): static
*/
public function setTempDirectory(string $dir): static
{
if (!FileSystem::isAbsolute($dir)) {
throw new Nette\InvalidArgumentException("Temporary directory must be absolute, '$dir' given.");
}
FileSystem::createDir($dir);
$this->tempDirectory = $dir;
return $this;
Expand Down

0 comments on commit 6ce2045

Please sign in to comment.