public function getRepositoryManager()
    {
        if (!$this->started) {
            throw new LogicException('Puli was not started');
        }

        if (!$this->repositoryManager && $this->context instanceof ProjectContext) {
            $this->repositoryManager = new RepositoryManagerImpl(
                $this->context,
                $this->getRepository(),
                $this->getModuleManager()->findModules(Expr::method('isEnabled', Expr::same(true))),
                $this->getJsonStorage()
            );
        }

        return $this->repositoryManager;
    }