mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 16:04:23 +00:00
Setup git repo on settings change
This commit is contained in:
@@ -42,6 +42,15 @@ func New(rootDir string, settings *models.Settings) *FileSystem {
|
||||
return fs
|
||||
}
|
||||
|
||||
func (fs *FileSystem) SetupGitRepo(gitURL string, gitUser string, gitToken string) error {
|
||||
fs.GitRepo = gitutils.New(gitURL, gitUser, gitToken, fs.RootDir)
|
||||
return fs.InitializeGitRepo()
|
||||
}
|
||||
|
||||
func (fs *FileSystem) DisableGitRepo() {
|
||||
fs.GitRepo = nil;
|
||||
}
|
||||
|
||||
func (fs *FileSystem) InitializeGitRepo() error {
|
||||
if fs.GitRepo == nil {
|
||||
return errors.New("git settings not configured")
|
||||
|
||||
Reference in New Issue
Block a user