Skip to content

Commit

Permalink
fix: WireFileTools error if templates/less doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
gebeer authored and BernhardBaumrock committed Oct 6, 2023
1 parent a8695ab commit 4c2c352
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,10 @@ public function createCustomLess(HookEvent $event): void
$file = $this->lessFilePath();
if (is_file($file)) return;
$less = $this->wire->pages->get(1)->getFormatted(self::field_less);
$this->wire->files->filePutContents($file, $less);
// create only if directory templates/less exists
if (is_dir($this->wire->config->paths->templates . "less")) {
$this->wire->files->filePutContents($file, $less);
}
}

/**
Expand Down

0 comments on commit 4c2c352

Please sign in to comment.