sync: Add Git Importer
This commit is contained in:
parent
aebfb7bf96
commit
89ca192890
4 changed files with 201 additions and 0 deletions
|
|
@ -67,6 +67,7 @@ func main() {
|
|||
cloudUsername := "fic"
|
||||
cloudPassword := ""
|
||||
localImporterDirectory := ""
|
||||
gitImporterRemote := ""
|
||||
localImporterSymlink := false
|
||||
baseURL := "/"
|
||||
|
||||
|
|
@ -108,6 +109,8 @@ func main() {
|
|||
"Base directory where found challenges files to import, local part")
|
||||
flag.BoolVar(&localImporterSymlink, "localimportsymlink", localImporterSymlink,
|
||||
"Copy files or just create symlink?")
|
||||
flag.StringVar(&gitImporterRemote, "git-import-remote", gitImporterRemote,
|
||||
"Remote URL of the git repository to use as synchronization source")
|
||||
flag.StringVar(&cloudDAVBase, "clouddav", cloudDAVBase,
|
||||
"Base directory where found challenges files to import, cloud part")
|
||||
flag.StringVar(&cloudUsername, "clouduser", cloudUsername, "Username used to sync")
|
||||
|
|
@ -122,6 +125,11 @@ func main() {
|
|||
if localImporterDirectory != "" && cloudDAVBase != "" {
|
||||
log.Fatal("Cannot have both --clouddav and --localimport defined.")
|
||||
return
|
||||
} else if gitImporterRemote != "" && cloudDAVBase != "" {
|
||||
log.Fatal("Cannot have both --clouddav and --git-import-remote defined.")
|
||||
return
|
||||
} else if gitImporterRemote != "" {
|
||||
sync.GlobalImporter = sync.NewGitImporter(sync.LocalImporter{Base: localImporterDirectory, Symlink: localImporterSymlink}, gitImporterRemote)
|
||||
} else if localImporterDirectory != "" {
|
||||
sync.GlobalImporter = sync.LocalImporter{Base: localImporterDirectory, Symlink: localImporterSymlink}
|
||||
} else if cloudDAVBase != "" {
|
||||
|
|
|
|||
Reference in a new issue