Skip to content

Commit

Permalink
fixed --force which should also remove Twig template cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Sep 15, 2015
1 parent 006223c commit 99062cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sami/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ protected function renderVersion(Version $version, $previous, $callback = null,
$this->seedCache($previous, $this->getBuildDir());
}

$diff = $this->renderer->render($this, $callback);
$diff = $this->renderer->render($this, $callback, $force);

if (null !== $callback) {
call_user_func($callback, Message::RENDER_VERSION_FINISHED, $diff);
Expand Down
8 changes: 6 additions & 2 deletions Sami/Renderer/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ public function isRendered(Project $project)
return $this->getDiff($project)->isAlreadyRendered();
}

public function render(Project $project, $callback = null)
public function render(Project $project, $callback = null, $force = false)
{
$this->twig->setCache($project->getCacheDir().'/twig');
$this->twig->setCache($cacheDir = $project->getCacheDir().'/twig');

if ($force) {
$project->flushDir($cacheDir);
}

$diff = $this->getDiff($project);

Expand Down

0 comments on commit 99062cf

Please sign in to comment.