Fix new snip error with git repo

Allow simple raw rendering (in html)
This commit is contained in:
Tim
2023-04-04 23:44:10 +02:00
parent 842c936d8c
commit 607435bff0
2 changed files with 34 additions and 7 deletions

View File

@ -19,6 +19,7 @@ class SnipService
{
$git = new Git();
$repoPath = sprintf('%s/%s', $snipBasePath, $snip->getId());
dump($repoPath, $snip);
if (!is_dir($repoPath)) {
$this->repo = $git->init($repoPath);
} else {
@ -38,6 +39,7 @@ class SnipService
public function update(string $snipContents): void
{
dump($this->getSnipPath());
file_put_contents($this->getSnipPath(), $snipContents);
$this->repo->addFile('snip.txt');
if ($this->repo->hasChanges()) {