From bd450775c4e123715c836cc4e959d21ad6eecaf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20K=C3=BCsgen?= Date: Tue, 17 Jan 2017 17:54:14 +0100 Subject: [PATCH] feat: use composer dependency if applicable --- helpers.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/helpers.php b/helpers.php index 2966a4b..3863f25 100644 --- a/helpers.php +++ b/helpers.php @@ -20,7 +20,16 @@ public function __construct($repoPath = false) private function initRepo() { if (!class_exists("Git")) { - require('Git.php/Git.php'); + if (file_exists('Git.php/Git.php')) { + require 'Git.php/Git.php'; + } else { + require kirby()->roots()->index() . + DS . 'vendor' . DS . 'pascalmh' . DS . 'git.php' . DS . 'Git.php'; + } + } + + if (!class_exists("Git")) { + die('Git class not found. Is the Git.php submodule installed?'); } $this->pullOnChange = c::get('gcapc-pull', false);